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

  • 5,049 views
Uploaded 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. …

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.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
5,049
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
0
Comments
0
Likes
7

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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.

Transcript

  • 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. Introduction
    • 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
      • Contact: guido.schmutz@trivadis.com
    Best Practices for the testing of SOA-based systems
  • 3. 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.
  • 4. 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 the testing of SOA-based systems Data are always part of the game.
  • 5. 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 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
  • 6. Challenges for testing a SOA solution
    • SOA environments are inherently heterogeneous
    • SOA solutions typically integrate a set of packaged or custom applications
    • It may not be possible to re-create a dedicated testing environment for all the systems involved
    • Tests are usually carried out in a synchronous way, SOA often works asynchronously!
    • Business processes often depend on timed events
    • Minimal unit of test in a SOA tends to be larger and more data driven than in traditional applications
    • Testing tools for SOA solutions are not yet readily
    Best Practices for the testing of SOA-based systems
  • 7. Automatic Testing
    • 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
  • 8. Functionalities of a Test Framework
    • 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
  • 9. Unit / Component Testing
    • Focuses on a specific component in the system
    • Outside dependencies must be isolated as much as possible to assure that the component can be tested in isolation
    • Easier to achieve with low-level component, which have none or almost no dependencies
    • Integration issues between components may not be discovered
    • Ensures that when integration begins we can have confidence in the functionality of each component being integrated
    Best Practices for the testing of SOA-based systems
  • 10. Integration Testing
    • 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
    Best Practices for the testing of SOA-based systems
  • 11. 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 the testing of SOA-based systems Data are always part of the game.
  • 12. Sample scenario Request Generate ID Read customer info Validate credit card Internally Externally Best Practices for the testing of SOA-based systems
  • 13. Implementation with SOA Suite 11g
    • 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
  • 14. 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 the testing of SOA-based systems Data are always part of the game.
  • 15. Unit testing of a Mediator 11g component
    • 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)
    • This way it can be tested, that the Routing and Transformation logic in the Mediator works correctly
    • This can be achieved with the SOA Suite Unit Testing Framework
      • Services can be simulated
      • Results can be verified
    Best Practices for the testing of SOA-based systems
  • 16. Unit testing of a Mediator 11g 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 the testing of SOA-based systems
  • 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. Unit testing of a 11g BPEL component
    • CustomerMediator will be called, but the database access (via DB-Adapter) will only be simulated
    • Answer of CreditCardService will only be simulated
    • Allocation of the booking ID will only be 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 the testing of SOA-based systems
  • 19. Deployment of 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 the testing of SOA-based systems
  • 20. 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 the testing of SOA-based systems Data are always part of the game.
  • 21. Integration Testing of SOA solutions
    • 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
  • 22. Integration Testing of SOA solutions
    • 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
    Best Practices for the testing of SOA-based systems
  • 23. But how to I get these Mock Services?
    • How should we implement Mock Services?
    • 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
  • 24. soapUI
    • Utility for the testing of a SOA
    • Available in a free version
    • 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
  • 25. Mock Service for the Visa Service Best Practices for the testing of SOA-based systems
  • 26. Testing a Webservice with soapUI Best Practices for the testing of SOA-based systems
  • 27. 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 the testing of SOA-based systems Data are always part of the game.
  • 28. 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
    • 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
  • 29. Thank you! DOAG conference 2009 Guido Schmutz, Technology Manager / Partner Trivadis AG 18.11.2009, Nürnberg