Best Practices for Testing SOA Suite 11g based systems ODTUG 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 29.06.2010, Washington
Introduction Guido Schmutz Working for Trivadis for more than 13 years leading and independent IT service company operating in Germany, Austria and Switzerland Oracle ACE Director for Fusion Middleware and SOA Co-Author of different books Consultant, Trainer Software Architect for Java, Oracle, SOA and EDA More than 20 years of software development experience Contact:  [email_address] Blog:  http://guidoschmutz.wordpress.com/ Best Practices for Testing SOA Suite 11g based systems
About Trivadis Swiss IT consulting company 13 locations in Switzerland, Germany and Austria ~ 540 employees Key figures 2008 Services for more than 650 clients in over 1‘600 projects Over 150 service level agreements More than 5‘000 training participants Research and development budget:  CHF 6.0 Mio. / EUR 3.6 Mio.
Agenda Introduction Scenario with SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
Testing of SOA solutions 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/even more  important Often enterprise wide systems (backbone of an enterprise) Many different users Each single error can have a huge impact Even if SOA uses a lot of existing functionality, it’s  not enough to just test  the existing functionality A SOA adds some additional logic which needs to be tested as well! Router, Filter, Enrichment, Orchestration, Business Process Logic, Rules, … Best Practices for Testing SOA Suite 11g based systems
Challenges for testing SOA solutions SOA environments are  inherently heterogeneous SOA solutions typically  integrate  a set of packaged or custom applications not always possible  to provide a  dedicated testing environment  for all the systems involved SOA often works asynchronously Tests are usually carried out in a synchronous way, Business processes often depend on  timed events unit of test usually  larger  than in traditional applications  Best Practices for Testing SOA Suite 11g based systems
Automatic Testing Relies on  automatic, programmatic execution  of the different test scenarios results  can be verified against expected results Efficient development and execution of test cases only achievable through  Testing Frameworks i.E. JUnit for Java A Testing Framework provides some common, reusable components for Creating a test Executing a test  Verifying test results Best Practices for Testing SOA Suite 11g based systems
Functionalities of a Testing Framework Generator   Produces the test data  Executes the components under test Verifier/Asserter   Compares the actual test results with the expected results a  Verifier/Asserter  makes an accurate, binary decision whether a test was successful or not Mock/Stub   Testing component which simulates part of the system to be tested Best Practices for Testing SOA Suite 11g based systems
Focuses on  one specific component  of the system Outside dependencies  should be  isolated  as much as possible to ensure testing of the component in isolation Easier to achieve with low-level component Integration issues between components may not be discovered But later integration tests can rely on well-written and (unit)tested components Unit / Component Testing Best Practices for Testing SOA Suite 11g based systems
Integration Testing Focuses on  the interaction between  multiple components Focuses on the  lower layers first Because they have the least external dependencies If the test fails in a component of an upper layer, its less likely that the reason is a faulty lower layer component These have already been tested Also referred to as  Bottom-Up Testing Best Practices for Testing SOA Suite 11g based systems t
Agenda Introduction Scenario with SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
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
Sample scenario Request Generate ID Read customer info Validate credit card Internal External Best Practices for Testing SOA Suite 11g based systems
Implementation with SOA Suite 11g SCA composite with the Business Process and a Mediator for customer integration Credit card validation implemented as a service on the Oracle Service Bus service Routes to the right credit card institute to be called Best Practices for Testing SOA Suite 11g based systems
Artifacts to be tested BPEL/BPMN flow logic Decisions, Orchestrations Mediator logic OSB flow logic XQuery / XSL Transformations Business Rules Best Practices for Testing SOA Suite 11g based systems
Is this good enough? Best Practices for Testing SOA Suite 11g based systems OSB Console Enterprise Manager (EM)
Agenda Introduction Scenario with SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
Unit testing of a SOA Suite 11g SCA component 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 Testing SOA Suite 11g based systems
Unit testing of an 11g SCA component CustomerMediator  called, but database access  (via DB-Adapter) only simulated Answer of  CreditCardService  simulated Allocation of the request ID simulated Fixed and deterministic values are always returned Important to be able to test the answer with an  Asserter (Verifier) against an expected message Best Practices for Testing SOA Suite 11g based systems
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
Executing test cases Test cases will be deployed with the normal deployment of an SCA composite Unit tests can be executed via Enterprise Manager (EM) console Best Practices for Testing SOA Suite 11g based systems
Different Unit Testing Patterns With Mediator logic Without Mediator logic Best Practices for Testing SOA Suite 11g based systems With Customer Service Mediator only
Unit testing on an OSB service 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 Mocks for Visa and Amexco This way the Routing and Transformation logic can be tested Best Practices for Testing SOA Suite 11g based systems Amexco Visa Mock Generate Mock
But how do I get these Mock Services?  The Unit Testing Framework of SOA Suite 11g is not available for Oracle Service Bus services Should we start implementing the Mock Services as own web services with the language of our choice? One advantage of SOA is the standardized definition of the interfaces through WSDL and XSD There are more and more utilities/tools available, simplifying some of the tasks with a SOA solution Functional testing Load testing Best Practices for Testing SOA Suite 11g based systems
soapUI Tool for Web Service Testing Available in a free version Supports the Testing of SOAP as well as REST Web Services Covers the following functionalities: Inspection and call of web services Functional testing of web services Load testing of web services Creation of Web Service Dummies (Mock Services) Best Practices for Testing SOA Suite 11g based systems http://www.soapui.org/
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 Automated Unit testing of Transformations is not supported! developers tests are possible automated with XMLUnit ? Best Practices for Testing SOA Suite 11g based systems
Agenda Introduction Scenario with SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
Integration Testing of SOA solutions All the single components are deployed and wired together in a dedicated testing environment Can be automated using Ant / WLST connected with the corresponding test versions of the external services What should we do, if there is  no test version available  of a given (external) service? What should we do, if the service is  not yet  available? Best Practices for Testing SOA Suite 11g based systems
Integration Testing of SOA solutions How can the behavior of an external service be influenced? So that different outcomes can be tested to test the behavior of a SOA solution in an error case, the  error situation has to occur How to force an (external) service to produce an error at the right moment? The solution is again a Mock Service, which takes over the place of the external services Best Practices for Testing SOA Suite 11g based systems
Integration Testing with soapUI Tests can be combined into a Test Suite and run all together Tests can assert, that the right outcome of a service call Best Practices for Testing SOA Suite 11g based systems
Agenda Introduction Scenario with SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
Summary 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 Would be nice to be able to zoom into BPEL and BPMN with unit testing (was there in 10g) Integration Testing can be implemented with soapUI calling 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 Testing SOA Suite 11g based systems
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

Best Practices for testing SOA Suite 11g based systems

  • 1.
    Best Practices forTesting SOA Suite 11g based systems ODTUG 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 29.06.2010, Washington
  • 2.
    Introduction Guido SchmutzWorking for Trivadis for more than 13 years leading and independent IT service company operating in Germany, Austria and Switzerland Oracle ACE Director for Fusion Middleware and SOA Co-Author of different books Consultant, Trainer Software Architect for Java, Oracle, SOA and EDA More than 20 years of software development experience Contact: [email_address] Blog: http://guidoschmutz.wordpress.com/ Best Practices for Testing SOA Suite 11g based systems
  • 3.
    About Trivadis SwissIT consulting company 13 locations in Switzerland, Germany and Austria ~ 540 employees Key figures 2008 Services for more than 650 clients in over 1‘600 projects Over 150 service level agreements More than 5‘000 training participants Research and development budget: CHF 6.0 Mio. / EUR 3.6 Mio.
  • 4.
    Agenda Introduction Scenariowith SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
  • 5.
    Testing of SOAsolutions 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/even more important Often enterprise wide systems (backbone of an enterprise) Many different users Each single error can have a huge impact Even if SOA uses a lot of existing functionality, it’s not enough to just test the existing functionality A SOA adds some additional logic which needs to be tested as well! Router, Filter, Enrichment, Orchestration, Business Process Logic, Rules, … Best Practices for Testing SOA Suite 11g based systems
  • 6.
    Challenges for testingSOA solutions SOA environments are inherently heterogeneous SOA solutions typically integrate a set of packaged or custom applications not always possible to provide a dedicated testing environment for all the systems involved SOA often works asynchronously Tests are usually carried out in a synchronous way, Business processes often depend on timed events unit of test usually larger than in traditional applications Best Practices for Testing SOA Suite 11g based systems
  • 7.
    Automatic Testing Relieson automatic, programmatic execution of the different test scenarios results can be verified against expected results Efficient development and execution of test cases only achievable through Testing Frameworks i.E. JUnit for Java A Testing Framework provides some common, reusable components for Creating a test Executing a test Verifying test results Best Practices for Testing SOA Suite 11g based systems
  • 8.
    Functionalities of aTesting Framework Generator Produces the test data Executes the components under test Verifier/Asserter Compares the actual test results with the expected results a Verifier/Asserter makes an accurate, binary decision whether a test was successful or not Mock/Stub Testing component which simulates part of the system to be tested Best Practices for Testing SOA Suite 11g based systems
  • 9.
    Focuses on one specific component of the system Outside dependencies should be isolated as much as possible to ensure testing of the component in isolation Easier to achieve with low-level component Integration issues between components may not be discovered But later integration tests can rely on well-written and (unit)tested components Unit / Component Testing Best Practices for Testing SOA Suite 11g based systems
  • 10.
    Integration Testing Focuseson the interaction between multiple components Focuses on the lower layers first Because they have the least external dependencies If the test fails in a component of an upper layer, its less likely that the reason is a faulty lower layer component These have already been tested Also referred to as Bottom-Up Testing Best Practices for Testing SOA Suite 11g based systems t
  • 11.
    Agenda Introduction Scenariowith SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
  • 12.
    SOA Suite 11gR1PS2 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.
    Sample scenario RequestGenerate ID Read customer info Validate credit card Internal External Best Practices for Testing SOA Suite 11g based systems
  • 14.
    Implementation with SOASuite 11g SCA composite with the Business Process and a Mediator for customer integration Credit card validation implemented as a service on the Oracle Service Bus service Routes to the right credit card institute to be called Best Practices for Testing SOA Suite 11g based systems
  • 15.
    Artifacts to betested BPEL/BPMN flow logic Decisions, Orchestrations Mediator logic OSB flow logic XQuery / XSL Transformations Business Rules Best Practices for Testing SOA Suite 11g based systems
  • 16.
    Is this goodenough? Best Practices for Testing SOA Suite 11g based systems OSB Console Enterprise Manager (EM)
  • 17.
    Agenda Introduction Scenariowith SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
  • 18.
    Unit testing ofa SOA Suite 11g SCA component 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 Testing SOA Suite 11g based systems
  • 19.
    Unit testing ofan 11g SCA component CustomerMediator called, but database access (via DB-Adapter) only simulated Answer of CreditCardService simulated Allocation of the request ID simulated Fixed and deterministic values are always returned Important to be able to test the answer with an Asserter (Verifier) against an expected message Best Practices for Testing SOA Suite 11g based systems
  • 20.
    Initial message, willbe 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.
    Executing test casesTest cases will be deployed with the normal deployment of an SCA composite Unit tests can be executed via Enterprise Manager (EM) console Best Practices for Testing SOA Suite 11g based systems
  • 22.
    Different Unit TestingPatterns With Mediator logic Without Mediator logic Best Practices for Testing SOA Suite 11g based systems With Customer Service Mediator only
  • 23.
    Unit testing onan OSB service 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 Mocks for Visa and Amexco This way the Routing and Transformation logic can be tested Best Practices for Testing SOA Suite 11g based systems Amexco Visa Mock Generate Mock
  • 24.
    But how doI get these Mock Services? The Unit Testing Framework of SOA Suite 11g is not available for Oracle Service Bus services Should we start implementing the Mock Services as own web services with the language of our choice? One advantage of SOA is the standardized definition of the interfaces through WSDL and XSD There are more and more utilities/tools available, simplifying some of the tasks with a SOA solution Functional testing Load testing Best Practices for Testing SOA Suite 11g based systems
  • 25.
    soapUI Tool forWeb Service Testing Available in a free version Supports the Testing of SOAP as well as REST Web Services Covers the following functionalities: Inspection and call of web services Functional testing of web services Load testing of web services Creation of Web Service Dummies (Mock Services) Best Practices for Testing SOA Suite 11g based systems http://www.soapui.org/
  • 26.
    Mock Service forthe Visa Service Best Practices for Testing SOA Suite 11g based systems Mock
  • 27.
    Fault Response anddynamic values with soapUI Best Practices for Testing SOA Suite 11g based systems
  • 28.
    Executing WebService withsoapUI Best Practices for Testing SOA Suite 11g based systems Request Response
  • 29.
    Unit Testing TransformationsAutomated Unit testing of Transformations is not supported! developers tests are possible automated with XMLUnit ? Best Practices for Testing SOA Suite 11g based systems
  • 30.
    Agenda Introduction Scenariowith SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
  • 31.
    Integration Testing ofSOA solutions All the single components are deployed and wired together in a dedicated testing environment Can be automated using Ant / WLST connected with the corresponding test versions of the external services What should we do, if there is no test version available of a given (external) service? What should we do, if the service is not yet available? Best Practices for Testing SOA Suite 11g based systems
  • 32.
    Integration Testing ofSOA solutions How can the behavior of an external service be influenced? So that different outcomes can be tested to test the behavior of a SOA solution in an error case, the error situation has to occur How to force an (external) service to produce an error at the right moment? The solution is again a Mock Service, which takes over the place of the external services Best Practices for Testing SOA Suite 11g based systems
  • 33.
    Integration Testing withsoapUI Tests can be combined into a Test Suite and run all together Tests can assert, that the right outcome of a service call Best Practices for Testing SOA Suite 11g based systems
  • 34.
    Agenda Introduction Scenariowith SOA Suite 11g as an example Unit Testing of SOA Suite 11g components Integration Testing of SOA Suite 11g composites Summary Best Practices for Testing SOA Suite 11g based systems Data are always part of the game.
  • 35.
    Summary Best Practicesfor 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 Would be nice to be able to zoom into BPEL and BPMN with unit testing (was there in 10g) Integration Testing can be implemented with soapUI calling 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 Testing SOA Suite 11g based systems
  • 36.
    Thank you! ODTUG2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 29.6.2010, Washington
  • 37.
    Architecture Best Practicesfor Testing SOA Suite 11g based systems

Editor's Notes

  • #4 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.