Channels ▼


Testing Service Oriented Architectures

Source Code Accompanies This Article. Download It Now.

Unit Testing

Unit testing in SOA is not only the testing of components comprising a service, but also the testing of individual services in isolation. This can be done using a static or dynamic client that invokes the service. In this manner, functional and nonfunctional testing on a service can be done. Validity of the content in the request or response can be assessed via XPath or XQuery statements. This is perhaps the easiest of the tests to perform because preexisting Dynamic Invocation Interface (DII) clients are available (

Integration Testing

Integration testing in SOA is the testing of multiple services in the fulfillment of a use case or business process. Again, challenges arise in transparency within and among services since some of these services can cross organizational boundaries and leverage external systems.

Perhaps the most conceptually straightforward approach to integration testing of SOA is to use service proxies substituting for existing services. This lets the boundaries of the system of interest be simulated. For proxies to deliver meaningful content to these services, realistic data must be obtained. This can be done by monitoring the node that is transmitting the data and copying before sending the data forward. The proxy could then leverage the sample data for testing purposes. One means of generating proxies is to use DII and Dynamic Service Interfaces (DSI) and the interface definition. Pulling previously collected data from a data store provides an approximation of the actual service. A mechanism should be able to toggle between live or simulated data. Similarly, it should be possible to use the proxies to simulate network load and latency.

In addition to proxies, agents can be added to services through plug-in mechanisms. Agents allow monitoring of service inputs and outputs. Additionally, they can be used to monitor various metrics, such as time of processing or network behavior. The granularity of the agent (as a proxy, or else embedded in the service) would allow precise monitoring at multiple levels. If agents possess XPath and XQuery ability, then content validation can be executed too.

Code-Level Change and Instrumentation

When source code is available, test harness frameworks can perform code-level monitoring using utility classes or code instrumentation. One approach to code-level monitoring is to use aspects. In addition to introducing cross-cutting into the source code, aspect frameworks (such as AspectJ) can instrument libraries. Consequently, support for pointcuts and joinpoints can be introduced at a code level as needed. To reduce overhead, the aspect could be written to pass information to a separate monitoring program.

Another useful outcome of such a tool is coverage testing of services in a dynamic service composition environment. This enables an understanding of compositions favored by processes and an insight into which services are used or avoided by user communities.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.