Home > SOA All-in-One Guides > SOA Lifecycle > Deployment > Testing > Testing services: Integrity and scalability in SOA
All-in-One Guides: SOA Lifecycle:
EMAIL THIS
 START   FUNDAMENTALS   MODELING AND DESIGN   ASSEMBLY   DEPLOYMENT   MANAGEMENT   
Deployment


Testing
<< PREVIOUS | NEXT >>: Automate regression testing
 TIPS & NEWSLETTERS TOPICS 

THE WEB SERVICES ADVISOR

Testing services: Integrity and scalability in SOA


Daniel Rubio
02.20.2006
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


With the shift to develop software as reusable services, many paradigms in the software development cycle are being readdressed. Just as object orientated design requires a particular mindset to develop effectively, service-orientated architecture also brings its share of specific approaches. In the coming paragraphs, we will explore one of the many important facets to developing services: Testing.

Depending on the software management style in your organization, testing can often be a top priority or an overlooked process. The former approach, being in line with agile development techniques, stresses the need to incorporate testing thoroughly while business services are being written, while the latter takes the position of not testing until you have a 'ready to go' service.

While there are proponents which confirm that investing from the outset in testing and adopting agile principals far outweigh the benefits of leaving testing until the final development phases, we will leave the discussion of when to introduce testing to your particular project's constraints and instead focus on the how.

Testing is by no means a simple subject, there are many types of tests which can be performed on software. Depending on the complexity and gamut of tests, even dedicated groups -- QA teams -- can be employed for this particular task, but for practical purposes, we will focus on two types of testing which are relatively easy to develop: Unit and stress testing.

Unit testing refers to the process of verifying a service's intended purpose through a series of predefined data sets, which are used to mimic real world usage and thus detect flaws in a timely manner. When making unit tests for your services, you can think of them as your safety net before releasing services into production since you will have the ability to run predetermined sets of data through you service's logic before real data flows through them.

Another benefit ...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


<< PREVIOUS | NEXT >>: Automate regression testing
VIEW ALL IN THIS CATEGORY


RELATED CONTENT
The Web Services Advisor
What to expect with the new JavaScript standardization (ECMAScript 5)
Restlet framework wrestles RESTful Web applications
3 tips for choosing whether to use EGL
Use SoaML to facilitate Model Driven Architecture
Enterprise mashup patterns act as API enablers
XQuery learns to write using XUF
Descriptive Languages for RESTful Services
Notable Python language update on view
Try XML-based Extensible Business Reporting Language (XBRL) for accounting reports
Whatever happened to ''X''?

Testing
Automate regression testing
SOA changing the way testing is done
QA tries to wrap its arms around SOA testing

SOA performance
In SOA, cloud resources may exacerbate security and file transfers issues
Compuware to acquire SaaS provider Gomez for $295 million
APM suite from Oracle updated with Composite Application Monitor and Modeler
MicroFocus releases Modernization Workbench 2.1
APM software traces transactions across tiers, technologies
CA/Wily forwards transaction monitoring across distributed systems
Progress Actional update eyes end-to-end business transactions
Progress/Actional SOA diagnostic tool builds on Mindreef purchase
New year – same old SOA tempests?
BPM modeling tools said to boost business analyst abilities

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


unit testing brings to development becomes more apparent when your services start to age. Since evolving services imply modifications to the underlying logic, these changes may cause breakage to specific usage scenarios the services were intended to fulfill. However, armed with an existing suite of unit tests you are guaranteed that continued compliance with these tests protects any dependent party using your services from any breakages that can occur in newer revisions.

The actual writing of unit tests depends heavily on the programming language or platform you are using for deploying services, but more than likely will be done through a special framework in order to facilitate the bootstrapping, validation and deployment of tests – or in other words, automating all the 'plumbing' that entails unit testing.

Among the most popular frameworks for performing unit tests are: JUnit for Java and the Unit Testing Framework for .NET, the last of which forms part of Visual Studio. Illustrating the depth of either framework or some other unit testing suite would go beyond the scope of this article, but listing 1.1 illustrates what a JUnit test for a Java backed services would look like.

Listing 1.1 Unit test written in JUnit for Java classes used as Web Services

This test listing represents a unit test performed on two business logic classes that will eventually make up a Web service for determining Payroll data. Notice how an instance of both the Payroll and Employee classes are created, both of which are later manipulated inside the different testXXX() methods. Once manipulated, also notice the calls to the various JUnit methods named assertXXX().

The parameters used to call the various assert methods form the predefined pieces of data passed along to the underlying service classes, which upon being evaluated are compared to the expected values, at which point in time the testing framework will raise an error or return a successful test execution.

While unit testing is used to verify the integrity of a service's logic, stress testing is used to determine the behavior a service will have under a particular user load, a process that can also help determine the adequacy of a service's supporting infrastructure – like hardware capacity, application server configuration and bandwidth availability, among other things.

One tool which can aid you in stress testing services is JMeter , an open source project developed by the Apache foundation. Although JMeter is Java based, it can generate SOAP and XMLRPC type requests, effectively functioning as a Web services client to stress test any server side deployment. Figure 1.1 illustrates a screen shot of this tool performing a load test on a SOAP/XML-RPC service.

Figure 1.1 : JMeter stress test for Web services

[IMAGE]

The process for creating the aforementioned stress test in JMeter would be the following :

1. On JMeter's main screen, place your mouse on the Test Plan icon and do a right click. From the pop-up menu select : Add – Thread Group. The Thread Group icon will be created.

2. Place yourself on the Thread Group icon, the left hand side pane will show various parameters. The parameter Number of threads represents the number of requests your stress test will emulate to your service, modify accordingly.

3. Next, while on Thread Group icon do a right click. From the pop-up menu select: Add – Sampler – SOAP/XML-RPC Request. The SOAP/XML-RPC request icon will be created.

4. Place yourself on the SOAP/XML-RPC request icon, the left hand side pane will show various parameters. Introduce the URL of your Web service, as well as the payload you wish to send on each request.

5. Next, while on the SOAP/XML-RPC request icon do a right click. From the pop-up menu select: Add – Listener – Monitor Results, and also Add – Listener – View Results in Table. Two new icons that will represent the stress tests results will be generated. NOTE: You can add more Listener's if you require, which is JMeter's terminology for representing stress test results.

6. Save your test, and select the Run-Start option from the top level menus to start your stress test.

7. Finally, move along the various Listener icons to observe the performance metrics obtained when stressing your Web service.

In much the same nature as unit testing frameworks, illustrating the many intricacies of JMeter – or any other stress tool for that matter – would go beyond the scope of this article, but JMeter offers comprehensive and freely available documentation on its various stress testing functionalities.

With this we conclude our look at unit and stress testing in the context of Web services, two of the many testing procedures you can use in you service-oriented designs in order to assure the integrity and scalability of your deployments.

About the Author

Daniel Rubio is an independent technology consultant specializing in enterprise and Web-based software, He blogs regularly on these and other software areas at http://www.webforefront.com.




Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts