Basel · Baden · Bern · Lausanne · Zürich · Düsseldorf · Frankfurt/M. · Freiburg i. Br. · Hamburg · München · Stuttgart · Wien Best Practices for the testing of SOA-based systems – with examples of Oracle SOA Suite 11g DOAG conference 2009 Guido Schmutz, Technology Manager / Partner Trivadis AG 18.11.2009, Nürnberg
29
Embed
Best Practices for the testing of SOA-based systems – with examples of Oracle SOA Suite 11g
Generally, the purpose of testing is to assess applications quality. Many approaches existing for traditional software systems can be adapted or even reused for service-oriented systems. Service-oriented testing has many similarities with component-based testing.
The Oracle SOA Suite offers out of the box support for testing BPEL and Service Bus services. But is this enough? How can we test services which are dependent on external services not available at testing time? Is there an efficient way to mock these services? This session we will present solutions and best practices for testing service-oriented systems and show how testing can be improved by adding some 3rd party products to the Oracle SOA Suite, like SoapUI.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Basel · Baden · Bern · Lausanne · Zürich · Düsseldorf · Frankfurt/M. · Freiburg i. Br. · Hamburg · München · Stuttgart · Wien
Best Practices for the testing of SOA-based systems – with examples of Oracle SOA Suite 11g
DOAG conference 2009
Guido Schmutz,Technology Manager / Partner Trivadis AG
Guido Schmutz Working for Trivadis for more than 12 years Oracle Ace Director for Fusion Middleware and SOA Co-Author of different books Consultant, Trainer Software Architect for Java, Oracle, SOA
and EDA Member of Trivadis Architecture Board Trivadis Technology Manager
More than 20 years of software development experience
For testing N-tier solutions some common best practices have been established Unit and Integration Tests Test Driven Development / Test-First Approach Mock Objects
A lot of these approaches can be used/adapted for testing SOA solutions as well
Testing a SOA solution is as important Often enterprise wide systems (backbone of an enterpirse) Many different users Each single error can have a huge impact
Even if in a SOA a lot of existing functionality is used, it’s not enough to just test these SOA adds some additional logic via Router, Filter, Orchestration, which has to
be tested as well
Best Practices for the testing of SOA-based systems
Relies on automatic, programmatic execution of the different test scenarios
The results can be verified against expected results
Efficient development and execution of test cases can only be achieved with the help of Testing Frameworks
A Testing Framework provides some common, reusable components, which supports the creation and execution of test cases as well as the verification of test results.
Best Practices for the testing of SOA-based systems
Generator Produces the test data and with it calls the components under test
Verifier/Asserter Compares the actual test results with the expected results It’s important that a Verifier/Asserter makes an accurate, binary decision
whether a test was successful or not
Mock/Stub Testing component that simulates part of the system that is not under test
Best Practices for the testing of SOA-based systems
Focuses on the interaction between multiple components
Focuses on the lower layers first Because they have the least external dependencies
If an integration test fails in the upper layers, its unlikely that the reason is a faulty lower layer component since these components have already been tested
Also referred to as Bottom-Up Testing
Service
Mediator / ESB
BPEL
Service
G VMediator /
ESB
BPELG V
G V
Service Service
Mediator / ESB
Best Practices for the testing of SOA-based systems
SCA composite once for the process with the connection to the customer system and once for the credit card validation First SCA composite is called from the second
Credit card validation implemented as Mediator service Decides which credit card institute to be called
Business Process implemented through BPEL component
Best Practices for the testing of SOA-based systems
Oracle SOA Suite 11g provides a testing framework with the following features Definition of tests, assertions and emulations via JDeveloper Starting Tests from the EM console or via the command line using
ANT Test Reports via EM console or via JUnit report
A test case contains Initiation
Defines the services and operations, which will be called with test data Emulation
Defined the message or error, which will be returned from a reference or a component
Assertion Compares the message or part of the message against expected data
Best Practices for the testing of SOA-based systems
After the isolated testing of each single component, we can be sure, that these work correctly by itself
Now we also want to test them integrated
Each single components are deployed together against the testing environment and connected with the corresponding test versions of the external services
What should we do, if there is no test version available of a given service?
What should we do, if the service is not available at all?
Best Practices for the testing of SOA-based systems
How can the behavior of an external service can be influenced? So that all the different possibilities can be tested To be able to test the behavior of a SOA solution in an error case, the error
situation has to actually happen
How does somebody bring an (external) service to produce an error at the right moment?
The soluiton is again a Mock Service, which takes over the place of the external services
BPEL
G V
Mediator / ESB
M
Best Practices for the testing of SOA-based systems
The previously shown Unit Testing Framework of SOA Suite 11g is not available in the integration environment
Should we start implementing the Mock Services as own web services with the language of our choice, in such a was, that they can achieve the requirements mentioned before?
One advantage of SOA is the standardized description of the interfaces through the WSDL There are more and more utilities/tools, which uses such a WSDL as
the starting point to simplify some of the tasks within a SOA solution
Best Practices for the testing of SOA-based systems
Supports the Testing of SOAP as well as REST webservices
Covers these functionalities: Inspection and call of web services Functional testing of web services Load testing of web services Creation of Webservice-Dummies (Mock Services)
http://www.soapui.org/
Best Practices for the testing of SOA-based systems
Best Practices for testing conventional applications are valid for SOA solutions as well
Unit Testing of SCA components is well supported via the SOA Suite 11g testing framework Not complete yet, but already quite usable
Integration Testing can be implemented with soapUI, a well-known utility available in a free version calling a SOA Suite Services Creating a Mock Service for an external service soapUI is much more powerful than shown here
All the Tests shown can be automated
Best Practices for the testing of SOA-based systems
Basel · Baden · Bern · Lausanne · Zürich · Düsseldorf · Frankfurt/M. · Freiburg i. Br. · Hamburg · München · Stuttgart · Wien
Thank you!
DOAG conference 2009
Guido Schmutz,Technology Manager / Partner Trivadis AG