Best Practices for Testing SOA Suite 11g based systems ODTUG 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG ...
Introduction <ul><li>Guido Schmutz </li></ul><ul><ul><li>Working for Trivadis for more than 13 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></...
Challenges for testing SOA solutions <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>...
Functionalities of a Testing Framework <ul><li>Generator   </li></ul><ul><ul><li>Produces the test data  </li></ul></ul><u...
<ul><li>Focuses on  one specific component  of the system </li></ul><ul><li>Outside dependencies  should be  isolated  as ...
Integration Testing <ul><li>Focuses on  the interaction between  multiple components </li></ul><ul><li>Focuses on the  low...
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 11gR1 PS2 Architecture Oracle Restricted and Confidential Unified Runtime BPMN Policy Manager Optimized binding ...
Sample scenario Request Generate ID Read customer info Validate credit card Internal External Best Practices for Testing S...
Implementation with SOA Suite 11g <ul><li>SCA composite with the Business Process and a Mediator for customer integration ...
Artifacts to be tested <ul><li>BPEL/BPMN flow logic </li></ul><ul><ul><li>Decisions, Orchestrations </li></ul></ul><ul><li...
Is this good enough? Best Practices for Testing SOA Suite 11g based systems OSB Console Enterprise Manager (EM)
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 SOA Suite 11g SCA component <ul><li>Oracle SOA Suite 11g provides a testing framework with the following...
Unit testing of an 11g SCA component <ul><li>CustomerMediator  called, but database access  (via DB-Adapter) only simulate...
Initial message, will be  sent to the BPEL component ( Generator ) Emulated answer from customer service, without calling ...
Executing test cases <ul><li>Test cases will be deployed with the normal deployment of an SCA composite </li></ul><ul><li>...
Different Unit Testing Patterns <ul><li>With Mediator logic </li></ul><ul><li>Without Mediator logic </li></ul>Best Practi...
Unit testing on an OSB service <ul><li>In order to be able to test the OSB service isolated (as a unit) there must be a wa...
But how do I get these Mock Services?  <ul><li>The Unit Testing Framework of SOA Suite 11g is not available for Oracle Ser...
soapUI <ul><li>Tool for Web Service Testing </li></ul><ul><li>Available in a free version </li></ul><ul><li>Supports the T...
Mock Service for the Visa Service Best Practices for Testing SOA Suite 11g based systems Mock
Fault Response and dynamic values with soapUI Best Practices for Testing SOA Suite 11g based systems
Executing WebService with soapUI Best Practices for Testing SOA Suite 11g based systems Request Response
Unit Testing Transformations <ul><li>Automated Unit testing of Transformations is not supported! </li></ul><ul><ul><li>dev...
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>All the single components are deployed and wired together in a dedicated test...
Integration Testing of SOA solutions <ul><li>How can the behavior of an external service be influenced? </li></ul><ul><ul>...
Integration Testing with soapUI <ul><li>Tests can be combined into a Test Suite and run all together </li></ul><ul><li>Tes...
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! ODTUG 2010   Guido Schmutz, Technology Manager / Partner Trivadis AG 29.6.2010, Washington
Architecture Best Practices for Testing SOA Suite 11g based systems
Upcoming SlideShare
Loading in...5
×

Best Practices for testing SOA Suite 11g based systems

13,805

Published on

This presentation shows best practices for testing solutions developed for the SOA Suite 11g platform. Oracle SOA Suite 11g offers out-of-the-box support for testing BPEL and mediator 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? The session covers both unit testing as well as integration testing of SOA solutions

Published in: Technology
2 Comments
19 Likes
Statistics
Notes
  • Very good presentation !! Congratulations !! Would be nice if you add something about Continuous Integration, showing the scripts (ant, maven, etc) to automate the soa suite testing framework, automate the setup of soapui, and making the end-to-end automated test process.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • great stuff. IMHO even before you start defining your integration layout you should discuss how to mock/stub and test your bus.... TDD rules!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
13,805
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
2
Likes
19
Embeds 0
No embeds

No notes for slide
  • Hier könnte eine Kopfzeile stehen 29.06.10 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 SOA Suite 11g based systems

    1. 1. Best Practices for Testing SOA Suite 11g based systems ODTUG 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 29.06.2010, Washington
    2. 2. Introduction <ul><li>Guido Schmutz </li></ul><ul><ul><li>Working for Trivadis for more than 13 years </li></ul></ul><ul><ul><ul><li>leading and independent IT service company operating in Germany, Austria and Switzerland </li></ul></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>More than 20 years of software development experience </li></ul></ul><ul><ul><li>Contact: [email_address] </li></ul></ul><ul><ul><li>Blog: http://guidoschmutz.wordpress.com/ </li></ul></ul>Best Practices for Testing SOA Suite 11g 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 Testing SOA Suite 11g 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/even more important </li></ul><ul><ul><li>Often enterprise wide systems (backbone of an enterprise) </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 SOA uses a lot of existing functionality, it’s not enough to just test the existing functionality </li></ul><ul><ul><li>A SOA adds some additional logic which needs to be tested as well! </li></ul></ul><ul><ul><ul><li>Router, Filter, Enrichment, Orchestration, Business Process Logic, Rules, … </li></ul></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    6. 6. Challenges for testing SOA solutions <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>not always possible to provide a dedicated testing environment for all the systems involved </li></ul><ul><li>SOA often works asynchronously </li></ul><ul><ul><li>Tests are usually carried out in a synchronous way, </li></ul></ul><ul><li>Business processes often depend on timed events </li></ul><ul><li>unit of test usually larger than in traditional applications </li></ul>Best Practices for Testing SOA Suite 11g based systems
    7. 7. Automatic Testing <ul><li>Relies on automatic, programmatic execution of the different test scenarios </li></ul><ul><li>results can be verified against expected results </li></ul><ul><li>Efficient development and execution of test cases only achievable through Testing Frameworks </li></ul><ul><ul><li>i.E. JUnit for Java </li></ul></ul><ul><li>A Testing Framework provides some common, reusable components for </li></ul><ul><ul><li>Creating a test </li></ul></ul><ul><ul><li>Executing a test </li></ul></ul><ul><ul><li>Verifying test results </li></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    8. 8. Functionalities of a Testing Framework <ul><li>Generator </li></ul><ul><ul><li>Produces the test data </li></ul></ul><ul><ul><li>Executes 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>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 which simulates part of the system to be tested </li></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    9. 9. <ul><li>Focuses on one specific component of the system </li></ul><ul><li>Outside dependencies should be isolated as much as possible to ensure testing of the component in isolation </li></ul><ul><ul><li>Easier to achieve with low-level component </li></ul></ul><ul><li>Integration issues between components may not be discovered </li></ul><ul><ul><li>But later integration tests can rely on well-written and (unit)tested components </li></ul></ul>Unit / Component Testing Best Practices for Testing SOA Suite 11g 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 the test fails in a component of an upper layer, its less likely that the reason is a faulty lower layer component </li></ul><ul><ul><li>These have already been tested </li></ul></ul><ul><li>Also referred to as Bottom-Up Testing </li></ul>Best Practices for Testing SOA Suite 11g based systems t
    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 Testing SOA Suite 11g based systems Data are always part of the game.
    12. 12. SOA Suite 11gR1 PS2 Architecture Oracle Restricted and Confidential Unified Runtime BPMN Policy Manager Optimized binding Human Workflow (+AMX, AG, Orgn) Business Rules Oracle Service Bus Common JCA-based connectivity infrastructure Repository EM console +BPMN Screens BAM B2B Mediator Workspace Process Portal (WC spaces) MS Office BPM Studio (with Business and IT views) Shared BPMN Model Business View BPA BPMN 2.0, BPEL Rich End User Interaction Web based customization Process Composer BPEL Process Analytics Proc Cubes
    13. 13. Sample scenario Request Generate ID Read customer info Validate credit card Internal External Best Practices for Testing SOA Suite 11g based systems
    14. 14. Implementation with SOA Suite 11g <ul><li>SCA composite with the Business Process and a Mediator for customer integration </li></ul><ul><li>Credit card validation implemented as a service on the Oracle Service Bus service </li></ul><ul><ul><li>Routes to the right credit card institute to be called </li></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    15. 15. Artifacts to be tested <ul><li>BPEL/BPMN flow logic </li></ul><ul><ul><li>Decisions, Orchestrations </li></ul></ul><ul><li>Mediator logic </li></ul><ul><li>OSB flow logic </li></ul><ul><li>XQuery / XSL Transformations </li></ul><ul><li>Business Rules </li></ul>Best Practices for Testing SOA Suite 11g based systems
    16. 16. Is this good enough? Best Practices for Testing SOA Suite 11g based systems OSB Console Enterprise Manager (EM)
    17. 17. 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 Testing SOA Suite 11g based systems Data are always part of the game.
    18. 18. Unit testing of a SOA Suite 11g SCA 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 Testing SOA Suite 11g based systems
    19. 19. Unit testing of an 11g SCA component <ul><li>CustomerMediator called, but database access (via DB-Adapter) only simulated </li></ul><ul><li>Answer of CreditCardService simulated </li></ul><ul><li>Allocation of the request ID 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 Testing SOA Suite 11g based systems
    20. 20. Initial message, will be sent to the BPEL component ( Generator ) Emulated answer from customer service, without calling the real service ( Mock ) Answer will be tested against the expected message ( Verifier ) Best Practices for Testing SOA Suite 11g based systems
    21. 21. Executing 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 Testing SOA Suite 11g based systems
    22. 22. Different Unit Testing Patterns <ul><li>With Mediator logic </li></ul><ul><li>Without Mediator logic </li></ul>Best Practices for Testing SOA Suite 11g based systems With Customer Service Mediator only
    23. 23. Unit testing on an OSB service <ul><li>In order to be able to test the OSB service isolated (as a unit) there must be a way to simulate the two service references </li></ul><ul><ul><li>Mocks for Visa and Amexco </li></ul></ul><ul><li>This way the Routing and Transformation logic can be tested </li></ul>Best Practices for Testing SOA Suite 11g based systems Amexco Visa Mock Generate Mock
    24. 24. But how do I get these Mock Services? <ul><li>The Unit Testing Framework of SOA Suite 11g is not available for Oracle Service Bus services </li></ul><ul><li>Should we start implementing the Mock Services as own web services with the language of our choice? </li></ul><ul><li>One advantage of SOA is the standardized definition of the interfaces through WSDL and XSD </li></ul><ul><ul><li>There are more and more utilities/tools available, simplifying some of the tasks with a SOA solution </li></ul></ul><ul><ul><ul><li>Functional testing </li></ul></ul></ul><ul><ul><ul><li>Load testing </li></ul></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    25. 25. soapUI <ul><li>Tool for Web Service Testing </li></ul><ul><li>Available in a free version </li></ul><ul><li>Supports the Testing of SOAP as well as REST Web Services </li></ul><ul><li>Covers the following 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 Web Service Dummies (Mock Services) </li></ul></ul>Best Practices for Testing SOA Suite 11g based systems http://www.soapui.org/
    26. 26. Mock Service for the Visa Service Best Practices for Testing SOA Suite 11g based systems Mock
    27. 27. Fault Response and dynamic values with soapUI Best Practices for Testing SOA Suite 11g based systems
    28. 28. Executing WebService with soapUI Best Practices for Testing SOA Suite 11g based systems Request Response
    29. 29. Unit Testing Transformations <ul><li>Automated Unit testing of Transformations is not supported! </li></ul><ul><ul><li>developers tests are possible </li></ul></ul><ul><ul><li>automated with XMLUnit ? </li></ul></ul>Best Practices for Testing SOA Suite 11g based systems
    30. 30. 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 Testing SOA Suite 11g based systems Data are always part of the game.
    31. 31. Integration Testing of SOA solutions <ul><li>All the single components are deployed and wired together in a dedicated testing environment </li></ul><ul><ul><li>Can be automated using Ant / WLST </li></ul></ul><ul><ul><li>connected with the corresponding test versions of the external services </li></ul></ul><ul><li>What should we do, if there is no test version available of a given (external) service? </li></ul><ul><li>What should we do, if the service is not yet available? </li></ul>Best Practices for Testing SOA Suite 11g based systems
    32. 32. Integration Testing of SOA solutions <ul><li>How can the behavior of an external service be influenced? </li></ul><ul><ul><li>So that different outcomes can be tested </li></ul></ul><ul><ul><li>to test the behavior of a SOA solution in an error case, the error situation has to occur </li></ul></ul><ul><ul><li>How to force an (external) service to produce an error at the right moment? </li></ul></ul><ul><li>The solution is again a Mock Service, which takes over the place of the external services </li></ul>Best Practices for Testing SOA Suite 11g based systems
    33. 33. Integration Testing with soapUI <ul><li>Tests can be combined into a Test Suite and run all together </li></ul><ul><li>Tests can assert, that the right outcome of a service call </li></ul>Best Practices for Testing SOA Suite 11g based systems
    34. 34. 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 Testing SOA Suite 11g based systems Data are always part of the game.
    35. 35. 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><ul><li>Would be nice to be able to zoom into BPEL and BPMN with unit testing (was there in 10g) </li></ul></ul><ul><li>Integration Testing can be implemented with soapUI </li></ul><ul><ul><li>calling 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 Testing SOA Suite 11g based systems
    36. 36. Thank you! ODTUG 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 29.6.2010, Washington
    37. 37. Architecture Best Practices for Testing SOA Suite 11g based systems

    ×