Best Practices for the testing of SOA-based systems –  with examples of Oracle SOA Suite 11g DOAG conference 2009   Guido ...
Introduction <ul><li>Guido Schmutz </li></ul><ul><ul><li>Working for Trivadis for more than 12 years </li></ul></ul><ul><u...
About Trivadis <ul><li>Swiss IT consulting company </li></ul><ul><ul><li>13 locations in Switzerland, Germany and Austria ...
Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of ...
Testing of SOA solutions <ul><li>For testing N-tier solutions some common best practices have been established </li></ul><...
Challenges for testing a SOA solution <ul><li>SOA environments are inherently heterogeneous </li></ul><ul><li>SOA solution...
Automatic Testing <ul><li>Relies on automatic, programmatic execution of the different test scenarios </li></ul><ul><li>Th...
Functionalities of a Test Framework <ul><li>Generator   </li></ul><ul><ul><li>Produces the test data and with it calls the...
Unit / Component Testing <ul><li>Focuses on a specific component in the system </li></ul><ul><li>Outside dependencies must...
Integration Testing <ul><li>Focuses on the interaction between multiple components </li></ul><ul><li>Focuses on the lower ...
Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of ...
Sample scenario Request Generate ID Read customer info Validate credit card Internally Externally Best Practices for the t...
Implementation with SOA Suite 11g <ul><li>SCA composite once for the process with the connection to the customer system an...
Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of ...
Unit testing of a Mediator 11g component <ul><li>In order to be able to test a Mediator component isolated (as a unit) the...
Unit testing of a Mediator 11g component <ul><li>Oracle SOA Suite 11g provides a testing framework with the following feat...
Initial message, will be  sent to the generator component ( Generator ) Given answer for the Visa service, without calling...
Unit testing of a 11g BPEL component <ul><li>CustomerMediator  will be called, but the database access (via DB-Adapter) wi...
Deployment of test cases <ul><li>Test cases will be deployed with the normal deployment of an SCA composite </li></ul><ul>...
Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of ...
Integration Testing of SOA solutions <ul><li>After the isolated testing of each single component, we can be sure, that the...
Integration Testing of SOA solutions <ul><li>How can the behavior of an external service can be influenced? </li></ul><ul>...
But how to I get these Mock Services?  <ul><li>How should we implement Mock Services? </li></ul><ul><li>The previously sho...
soapUI <ul><li>Utility for the testing of a SOA </li></ul><ul><li>Available in a free version </li></ul><ul><li>Supports t...
Mock Service for the Visa Service Best Practices for the testing of SOA-based systems
Testing a Webservice with soapUI Best Practices for the testing of SOA-based systems
Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of ...
Summary <ul><li>Best Practices for testing conventional applications are valid for SOA solutions as well </li></ul><ul><li...
Thank you! DOAG conference 2009   Guido Schmutz, Technology Manager / Partner Trivadis AG 18.11.2009, Nürnberg
Upcoming SlideShare
Loading in...5
×

Best Practices for testing of SOA-based systems - with examples of SOA Suite 11g

5,383

Published on

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.

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,383
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide
  • Hier könnte eine Kopfzeile stehen 03.12.09 Hier könnte eine Fusszeile stehen Ihr müsst nicht alle Punkt aufzählen. Vielleicht der Hinweis, CH-Unternehmen mit 13 Standorten in D-A-CH, Anzahl Mitarbeiter und das wir finanziell unabhängig sind.
  • Best Practices for testing of SOA-based systems - with examples of SOA Suite 11g

    1. 1. 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
    2. 2. Introduction <ul><li>Guido Schmutz </li></ul><ul><ul><li>Working for Trivadis for more than 12 years </li></ul></ul><ul><ul><li>Oracle Ace Director for Fusion Middleware and SOA </li></ul></ul><ul><ul><li>Co-Author of different books </li></ul></ul><ul><ul><li>Consultant, Trainer Software Architect for Java, Oracle, SOA and EDA </li></ul></ul><ul><ul><li>Member of Trivadis Architecture Board </li></ul></ul><ul><ul><li>Trivadis Technology Manager </li></ul></ul><ul><ul><li>More than 20 years of software development experience </li></ul></ul><ul><ul><li>Contact: guido.schmutz@trivadis.com </li></ul></ul>Best Practices for the testing of SOA-based systems
    3. 3. About Trivadis <ul><li>Swiss IT consulting company </li></ul><ul><ul><li>13 locations in Switzerland, Germany and Austria </li></ul></ul><ul><ul><li>~ 540 employees </li></ul></ul><ul><li>Key figures 2008 </li></ul><ul><ul><li>Services for more than 650 clients in over 1‘600 projects </li></ul></ul><ul><ul><li>Over 150 service level agreements </li></ul></ul><ul><ul><li>More than 5‘000 training participants </li></ul></ul><ul><ul><li>Research and development budget: CHF 6.0 Mio. / EUR 3.6 Mio. </li></ul></ul>
    4. 4. Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of SOA Suite 11g components </li></ul><ul><li>Integration Testing of SOA Suite 11g composites </li></ul><ul><li>Summary </li></ul>Best Practices for the testing of SOA-based systems Data are always part of the game.
    5. 5. Testing of SOA solutions <ul><li>For testing N-tier solutions some common best practices have been established </li></ul><ul><ul><li>Unit and Integration Tests </li></ul></ul><ul><ul><li>Test Driven Development / Test-First Approach </li></ul></ul><ul><ul><li>Mock Objects </li></ul></ul><ul><li>A lot of these approaches can be used/adapted for testing SOA solutions as well </li></ul><ul><li>Testing a SOA solution is as important </li></ul><ul><ul><li>Often enterprise wide systems (backbone of an enterpirse) </li></ul></ul><ul><ul><li>Many different users </li></ul></ul><ul><ul><li>Each single error can have a huge impact </li></ul></ul><ul><li>Even if in a SOA a lot of existing functionality is used, it’s not enough to just test these </li></ul><ul><ul><li>SOA adds some additional logic via Router, Filter, Orchestration, which has to be tested as well </li></ul></ul>Best Practices for the testing of SOA-based systems
    6. 6. Challenges for testing a SOA solution <ul><li>SOA environments are inherently heterogeneous </li></ul><ul><li>SOA solutions typically integrate a set of packaged or custom applications </li></ul><ul><li>It may not be possible to re-create a dedicated testing environment for all the systems involved </li></ul><ul><li>Tests are usually carried out in a synchronous way, SOA often works asynchronously! </li></ul><ul><li>Business processes often depend on timed events </li></ul><ul><li>Minimal unit of test in a SOA tends to be larger and more data driven than in traditional applications </li></ul><ul><li>Testing tools for SOA solutions are not yet readily </li></ul>Best Practices for the testing of SOA-based systems
    7. 7. Automatic Testing <ul><li>Relies on automatic, programmatic execution of the different test scenarios </li></ul><ul><li>The results can be verified against expected results </li></ul><ul><li>Efficient development and execution of test cases can only be achieved with the help of Testing Frameworks </li></ul><ul><li>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. </li></ul>Best Practices for the testing of SOA-based systems
    8. 8. Functionalities of a Test Framework <ul><li>Generator </li></ul><ul><ul><li>Produces the test data and with it calls the components under test </li></ul></ul><ul><li>Verifier/Asserter </li></ul><ul><ul><li>Compares the actual test results with the expected results </li></ul></ul><ul><ul><li>It’s important that a Verifier/Asserter makes an accurate, binary decision whether a test was successful or not </li></ul></ul><ul><li>Mock/Stub </li></ul><ul><ul><li>Testing component that simulates part of the system that is not under test </li></ul></ul>Best Practices for the testing of SOA-based systems
    9. 9. Unit / Component Testing <ul><li>Focuses on a specific component in the system </li></ul><ul><li>Outside dependencies must be isolated as much as possible to assure that the component can be tested in isolation </li></ul><ul><li>Easier to achieve with low-level component, which have none or almost no dependencies </li></ul><ul><li>Integration issues between components may not be discovered </li></ul><ul><li>Ensures that when integration begins we can have confidence in the functionality of each component being integrated </li></ul>Best Practices for the testing of SOA-based systems
    10. 10. Integration Testing <ul><li>Focuses on the interaction between multiple components </li></ul><ul><li>Focuses on the lower layers first </li></ul><ul><ul><li>Because they have the least external dependencies </li></ul></ul><ul><li>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 </li></ul><ul><li>Also referred to as Bottom-Up Testing </li></ul>Best Practices for the testing of SOA-based systems
    11. 11. Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of SOA Suite 11g components </li></ul><ul><li>Integration Testing of SOA Suite 11g composites </li></ul><ul><li>Summary </li></ul>Best Practices for the testing of SOA-based systems Data are always part of the game.
    12. 12. Sample scenario Request Generate ID Read customer info Validate credit card Internally Externally Best Practices for the testing of SOA-based systems
    13. 13. Implementation with SOA Suite 11g <ul><li>SCA composite once for the process with the connection to the customer system and once for the credit card validation </li></ul><ul><ul><li>First SCA composite is called from the second </li></ul></ul><ul><li>Credit card validation implemented as Mediator service </li></ul><ul><ul><li>Decides which credit card institute to be called </li></ul></ul><ul><li>Business Process implemented through BPEL component </li></ul>Best Practices for the testing of SOA-based systems
    14. 14. Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of SOA Suite 11g components </li></ul><ul><li>Integration Testing of SOA Suite 11g composites </li></ul><ul><li>Summary </li></ul>Best Practices for the testing of SOA-based systems Data are always part of the game.
    15. 15. Unit testing of a Mediator 11g component <ul><li>In order to be able to test a Mediator component isolated (as a unit) there must be a way to simulate the two service references (Visa and Amexco) </li></ul><ul><li>This way it can be tested, that the Routing and Transformation logic in the Mediator works correctly </li></ul><ul><li>This can be achieved with the SOA Suite Unit Testing Framework </li></ul><ul><ul><li>Services can be simulated </li></ul></ul><ul><ul><li>Results can be verified </li></ul></ul>Best Practices for the testing of SOA-based systems
    16. 16. Unit testing of a Mediator 11g component <ul><li>Oracle SOA Suite 11g provides a testing framework with the following features </li></ul><ul><ul><li>Definition of tests, assertions and emulations via JDeveloper </li></ul></ul><ul><ul><li>Starting Tests from the EM console or via the command line using ANT </li></ul></ul><ul><ul><li>Test Reports via EM console or via JUnit report </li></ul></ul><ul><li>A test case contains </li></ul><ul><ul><li>Initiation </li></ul></ul><ul><ul><ul><li>Defines the services and operations, which will be called with test data </li></ul></ul></ul><ul><ul><li>Emulation </li></ul></ul><ul><ul><ul><li>Defined the message or error, which will be returned from a reference or a component </li></ul></ul></ul><ul><ul><li>Assertion </li></ul></ul><ul><ul><ul><li>Compares the message or part of the message against expected data </li></ul></ul></ul>Best Practices for the testing of SOA-based systems
    17. 17. Initial message, will be sent to the generator component ( Generator ) Given answer for the Visa service, without calling the real service ( Mock ) Answer will be tested against the expected message ( Verifier ) Best Practices for the testing of SOA-based systems
    18. 18. Unit testing of a 11g BPEL component <ul><li>CustomerMediator will be called, but the database access (via DB-Adapter) will only be simulated </li></ul><ul><li>Answer of CreditCardService will only be simulated </li></ul><ul><li>Allocation of the booking ID will only be simulated </li></ul><ul><ul><li>Fixed and deterministic values are always returned </li></ul></ul><ul><ul><li>Important to be able to test the answer with an Asserter (Verifier) against an expected message </li></ul></ul>Best Practices for the testing of SOA-based systems
    19. 19. Deployment of test cases <ul><li>Test cases will be deployed with the normal deployment of an SCA composite </li></ul><ul><li>Unit tests can be executed via Enterprise Manager (EM) console </li></ul>Best Practices for the testing of SOA-based systems
    20. 20. Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of SOA Suite 11g components </li></ul><ul><li>Integration Testing of SOA Suite 11g composites </li></ul><ul><li>Summary </li></ul>Best Practices for the testing of SOA-based systems Data are always part of the game.
    21. 21. Integration Testing of SOA solutions <ul><li>After the isolated testing of each single component, we can be sure, that these work correctly by itself </li></ul><ul><li>Now we also want to test them integrated </li></ul><ul><li>Each single components are deployed together against the testing environment and connected with the corresponding test versions of the external services </li></ul><ul><li>What should we do, if there is no test version available of a given service? </li></ul><ul><li>What should we do, if the service is not available at all? </li></ul>Best Practices for the testing of SOA-based systems
    22. 22. Integration Testing of SOA solutions <ul><li>How can the behavior of an external service can be influenced? </li></ul><ul><ul><li>So that all the different possibilities can be tested </li></ul></ul><ul><ul><li>To be able to test the behavior of a SOA solution in an error case, the error situation has to actually happen </li></ul></ul><ul><li>How does somebody bring an (external) service to produce an error at the right moment? </li></ul><ul><li>The soluiton is again a Mock Service, which takes over the place of the external services </li></ul>Best Practices for the testing of SOA-based systems
    23. 23. But how to I get these Mock Services? <ul><li>How should we implement Mock Services? </li></ul><ul><li>The previously shown Unit Testing Framework of SOA Suite 11g is not available in the integration environment </li></ul><ul><li>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? </li></ul><ul><li>One advantage of SOA is the standardized description of the interfaces through the WSDL </li></ul><ul><ul><li>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 </li></ul></ul>Best Practices for the testing of SOA-based systems
    24. 24. soapUI <ul><li>Utility for the testing of a SOA </li></ul><ul><li>Available in a free version </li></ul><ul><li>Supports the Testing of SOAP as well as REST webservices </li></ul><ul><li>Covers these functionalities: </li></ul><ul><ul><li>Inspection and call of web services </li></ul></ul><ul><ul><li>Functional testing of web services </li></ul></ul><ul><ul><li>Load testing of web services </li></ul></ul><ul><ul><li>Creation of Webservice-Dummies (Mock Services) </li></ul></ul>http://www.soapui.org/ Best Practices for the testing of SOA-based systems
    25. 25. Mock Service for the Visa Service Best Practices for the testing of SOA-based systems
    26. 26. Testing a Webservice with soapUI Best Practices for the testing of SOA-based systems
    27. 27. Agenda <ul><li>Introduction </li></ul><ul><li>Scenario with SOA Suite 11g as an example </li></ul><ul><li>Unit Testing of SOA Suite 11g components </li></ul><ul><li>Integration Testing of SOA Suite 11g composites </li></ul><ul><li>Summary </li></ul>Best Practices for the testing of SOA-based systems Data are always part of the game.
    28. 28. Summary <ul><li>Best Practices for testing conventional applications are valid for SOA solutions as well </li></ul><ul><li>Unit Testing of SCA components is well supported via the SOA Suite 11g testing framework </li></ul><ul><ul><li>Not complete yet, but already quite usable </li></ul></ul><ul><li>Integration Testing can be implemented with soapUI, a well-known utility available in a free version </li></ul><ul><ul><li>calling a SOA Suite Services </li></ul></ul><ul><ul><li>Creating a Mock Service for an external service </li></ul></ul><ul><ul><li>soapUI is much more powerful than shown here </li></ul></ul><ul><li>All the Tests shown can be automated </li></ul>Best Practices for the testing of SOA-based systems
    29. 29. Thank you! DOAG conference 2009 Guido Schmutz, Technology Manager / Partner Trivadis AG 18.11.2009, Nürnberg

    ×