Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Collaborative Testing of Web Services -- The Service oriented framework and implementation in Semantic WS Hong Zhu Department of Computing and Electronics Oxford Brookes University Oxford OX33 1HX, UK
  2. 2. Acknowledgement <ul><li>Mr. Yufeng Zhang , MSc student at the National University of Defence Technology, China </li></ul><ul><li>Mr. Qingning Huo , PhD student at Oxford Brookes University, UK </li></ul><ul><li>Dr. Sue Greenwood , Oxford Brookes University, UK </li></ul>
  3. 3. Overview <ul><li>Analyse the impact of the novel features of service-orientation on software testing </li></ul><ul><li>Identify the grant challenges in testing WS applications </li></ul><ul><li>Propose an framework to support testing WS </li></ul><ul><li>Report on prototype implementation of the framework and case studies </li></ul><ul><li>Compare with related works and discussion of future work </li></ul>
  4. 4. Characteristics of Web Services <ul><li>Web services is a distributed computing technique that offers more flexibility and looser coupling so that it is more suitable for internet computing. </li></ul><ul><li>The dominant of program-to-program interactions </li></ul><ul><ul><li>The components of WS applications (such as service providers): </li></ul></ul><ul><ul><ul><li>Autonomous : control their own resources and their own behaviours </li></ul></ul></ul><ul><ul><ul><li>Active : execution not triggered by message, and </li></ul></ul></ul><ul><ul><ul><li>Persistent : computational entities that last long time </li></ul></ul></ul><ul><ul><li>Interactions between components: </li></ul></ul><ul><ul><ul><li>Social ability : discover and establish interaction at runtime </li></ul></ul></ul><ul><ul><ul><li>Collaboration : as opposite to control, may refuse service, follow a complicated protocol, etc. </li></ul></ul></ul>
  5. 5. WS technique stack <ul><li>Basic standards: </li></ul><ul><ul><li>WSDL: service description and publication </li></ul></ul><ul><ul><li>UDDI: for service registration and retrieval </li></ul></ul><ul><ul><li>SOAP for service invocation and delivery </li></ul></ul><ul><li>More advanced standards for collaborations between service providers and requesters. </li></ul><ul><ul><li>BPEL4WS: business process and workflow models. </li></ul></ul><ul><ul><li>OWL-S: ontology for the description of semantics of services </li></ul></ul>Registry Provider Requester Search for services registered services register service request service deliver service
  6. 6. A typical scenario <ul><li>Car Insurance Broker </li></ul><ul><ul><li>Suppose that a fictitious car insurance broker CIB is developing a web-based system that provides a complete service of car insurance. </li></ul></ul><ul><li>End users: </li></ul><ul><ul><li>Submit car insurance requirements to CIB </li></ul></ul><ul><ul><li>Get quotes from various insurers </li></ul></ul><ul><ul><li>Select one insurer to insure the car </li></ul></ul><ul><ul><li>Submit payment information </li></ul></ul><ul><ul><li>Get insurance document//confirmation </li></ul></ul><ul><li>Broker: </li></ul><ul><ul><li>Take information about the user and the car </li></ul></ul><ul><ul><li>Check the validity of user’s information </li></ul></ul><ul><ul><li>Get quotes from insurers and pass them to the user </li></ul></ul><ul><ul><li>Get user’s selection of the insurer </li></ul></ul><ul><ul><li>Get insurance from the insurer and pass the payment to the selected insurer </li></ul></ul><ul><ul><li>Take commissions from the insurer or the user </li></ul></ul>
  7. 7. Structure of the CIB application End users Other service users Could be statically integrated Should be dynamically integrated for business flexibility and competence, and lower operation and maintenance cost CIB’s Services Bank B’s Services Insurance A 1 ’s Services Insurance A 2 ’s Services Insurance A n ’s Services GUI Interface CIB’s service requester WS Registry
  8. 8. Testing own side services (1) <ul><li>Similar to test software components. </li></ul><ul><li>Many existing work on software component testing can be applied or adapted with special considerations: </li></ul><ul><ul><li>The stateless feature of HTTP protocol; </li></ul></ul><ul><ul><li>XML encoding of the data passing between services as in SOAP standard; </li></ul></ul><ul><ul><li>Confirmation to the published descriptions: </li></ul></ul><ul><ul><ul><li>WSDL for the syntax of the services </li></ul></ul></ul><ul><ul><ul><li>workflow specification in BPEL4WS </li></ul></ul></ul><ul><ul><ul><li>semantic specification in e.g. OWL-S. </li></ul></ul></ul>Progresses on these issues have been made in the past few years
  9. 9. Testing own side services (2) <ul><li>Dealing with requesters’ abnormal behaviours </li></ul><ul><ul><li>The requesters are autonomous, thus they may stop cooperation in the middle of a transaction for many reasons, such as intentional quit, network failure, or failures of requester’s software system due to fault. </li></ul></ul><ul><ul><li>Burdens are on the testers to ensure that the system handles such abnormal behaviours properly. </li></ul></ul><ul><li>Dealing with unexpected usages/loads </li></ul><ul><ul><li>As all web-based applications, load balance is essential. </li></ul></ul><ul><ul><li>But, the knowledge of the usage of a WS may not be available during the design and implementation of the system. </li></ul></ul><ul><li>Dealing with incomplete systems </li></ul><ul><ul><li>A service may have to rely on other services to perform its functionality properly, thus hard to separate the testing of the own services from the integration testing, especially when it involves complicated workflows. </li></ul></ul><ul><ul><li>In the worst case, when WS is dynamically bound to the other services, the knowledge of their format and semantics can only be based on assumptions and standards. </li></ul></ul>
  10. 10. Testing of other side services <ul><li>Some similarity to component testing, however, the differences are dominant </li></ul><ul><ul><li>Lack of software artifacts </li></ul></ul><ul><ul><li>Lack of control over test executions </li></ul></ul><ul><ul><li>Lack of means of observation on system behaviour </li></ul></ul>
  11. 11. Lack of software artifacts <ul><li>The problem: </li></ul><ul><li>No design documents, No source code, No executable code </li></ul><ul><li>The impacts: </li></ul><ul><ul><li>For statically bound services, </li></ul></ul><ul><ul><ul><li>Techniques that automatically derive stubs from source code are not applicable </li></ul></ul></ul><ul><ul><ul><li>Automatic instrumentation of original source code or executable code is not applicable </li></ul></ul></ul><ul><ul><li>For dynamic bound services, </li></ul></ul><ul><ul><ul><li>Human involvement in the integration becomes completely impossible. </li></ul></ul></ul><ul><li>Possible solutions: </li></ul><ul><ul><li>(a) Derive test harness from WS descriptions; </li></ul></ul><ul><ul><li>(b) The service provider to make the test stubs and drivers available for integration. </li></ul></ul>
  12. 12. Lack of control over test executions <ul><li>Problem: </li></ul><ul><ul><li>Services are typically located on a computer on the Internet that testers have no control over its execution. </li></ul></ul><ul><li>Impact: </li></ul><ul><ul><li>Control over the execution has been essential to apply existing testing techniques and will continue to be essential for testing services: </li></ul></ul><ul><ul><ul><li>An invocation of the service as a test must be distinguished from a real request of the service. </li></ul></ul></ul><ul><ul><ul><li>System may be need to be restarted or put into a certain state to test it. </li></ul></ul></ul><ul><ul><ul><li>The situation could become much more complicated when a WS is simultaneously tested by many service requesters. </li></ul></ul></ul><ul><li>Possible solution: </li></ul><ul><ul><li>The service provider must provide a mechanism and a service that enable service requesters control the testing executions of the service. </li></ul></ul>Currently, there is no support to such mechanisms in W3C standards of WS.
  13. 13. Lack of means of observation <ul><li>The problem: </li></ul><ul><ul><li>A tester cannot observe the internal behaviours of the services </li></ul></ul><ul><li>The Impacts: </li></ul><ul><ul><li>No way to measure test coverage </li></ul></ul><ul><li>Possible solutions: </li></ul><ul><ul><li>The service provider provides a mechanism and the services to the outside tester to observe its software’s internal behaviour in order to achieve the test adequacy that a service requester requires. </li></ul></ul><ul><ul><li>The service provider opens its document, source code as well as other software artifacts that are necessary for testing to some trusted test service providers. </li></ul></ul>
  14. 14. Testing service composition <ul><li>The need to deal with diversity </li></ul><ul><ul><li>the parts may operate on a variety of the hardware and software platforms </li></ul></ul><ul><ul><li>different deployment configurations </li></ul></ul><ul><ul><li>delivering different quality of services. </li></ul></ul><ul><li>The need of testing on-the-fly </li></ul><ul><ul><li>testing just before the invocation </li></ul></ul><ul><li>Consequences of testing on-the-fly: </li></ul><ul><li>The need of non - intrusive testing: the test invocations of a service must be distinguished from the real ones </li></ul><ul><ul><li>service provider: the normal operation of the service must not disturbed by test activities. </li></ul></ul><ul><ul><li>client: do not actually receive the real services and do not incur the cost </li></ul></ul><ul><li>The need of automation : all test activities to be performed automatically. </li></ul>A typical scenario of service oriented computing is that a service requester searches for a required function in a registry, and then dynamically links to the service and invokes it.
  15. 15. Dealing with diversity <ul><li>The problem </li></ul><ul><ul><li>The need to deal with diversity </li></ul></ul><ul><li>The Implications </li></ul><ul><ul><li>testing must be performed in a heterogeneous environment. </li></ul></ul><ul><ul><li>different service requesters may well have different test requirements to meet their own business purposes </li></ul></ul><ul><li>Possible solutions </li></ul><ul><ul><li>Universal powerful testing tools: expensive if not impossible </li></ul></ul><ul><ul><li>Collaboration and integration of a variety of tools </li></ul></ul>
  16. 16. Testing on-the-fly <ul><li>The problem </li></ul><ul><ul><li>Test just before the invocation while the parts are in operation </li></ul></ul><ul><li>Implications </li></ul><ul><ul><li>human involvement is impossible </li></ul></ul><ul><ul><li>Not to interference with the normal operation </li></ul></ul><ul><li>Possible solutions </li></ul><ul><ul><li>Fully automated testing process </li></ul></ul><ul><ul><li>Mock services, etc. </li></ul></ul>
  17. 17. The proposed approach <ul><li>A WS should be accompanied by a testing service. </li></ul><ul><ul><li>functional services : the services of the original functionality </li></ul></ul><ul><ul><li>testing services : the services to enable test the functional services. </li></ul></ul><ul><li>Testing services can be either provided by the same vendor of the functional services, or by a third party. </li></ul><ul><li>Independent testing services: </li></ul><ul><ul><li>Provider: </li></ul></ul><ul><ul><ul><li>testing tool vendors </li></ul></ul></ul><ul><ul><ul><li>companies of specialized in software testing </li></ul></ul></ul><ul><ul><li>The services: </li></ul></ul><ul><ul><ul><li>to generate test cases, </li></ul></ul></ul><ul><ul><ul><li>to measure test adequacy, </li></ul></ul></ul><ul><ul><ul><li>to extract various types of diagrams from source code or design and specification documents, etc. </li></ul></ul></ul>
  18. 18. Architecture of service oriented testing
  19. 19. Illustration of service oriented testing
  20. 20. How does the system work <ul><li>The Scenario </li></ul><ul><li>Suppose the car insurance broker want to search for web services of insurers and test the web service before making quote for its customers. </li></ul>Car Insurance Broker CIB Insurer Web Service IS customer Information about the car and the user Insurance quotes Testing the integration of two services
  21. 22. Collaboration Process in the Typical Scenario
  22. 23. Automating Test Services <ul><li>The key technique issues to enable automated online test of WS: </li></ul><ul><ul><li>How a testing service should be described, published and registered at WS registry; </li></ul></ul><ul><ul><li>How a testing service can be retrieved automatically even for testing dynamically bound services; </li></ul></ul><ul><ul><li>How a testing service can be invoked by both a human tester and a program to dynamically discover a service and then test it before bind to it. </li></ul></ul><ul><ul><li>How testing results can be summarized and reported in the forms that are suitable for both human beings to read and machine to understand. </li></ul></ul>These issues can be resolved by the utilization of a software testing ontology (Zhu & Huo 2003, 2005).
  23. 24. STOWS: Software Testing Ontology for WS <ul><li>Ontology defines the basic terms and relations comprising the vocabulary of a topic area as well as the rules for combining them to define extensions to the vocabulary </li></ul><ul><li>STOWS is base on an ontology of software testing originally developed for agent oriented software testing (Zhu & Huo 2003, 2005). </li></ul><ul><ul><li>The concepts of software testing are divided into two groups. </li></ul></ul><ul><ul><li>Knowledge about software testing are also represented as relations between concepts </li></ul></ul>
  24. 25. STOWS (1): Basic concepts <ul><li>Tester : a particular party who carries out a testing activity. </li></ul><ul><li>Activity : consists of actions performed in testing process, including test planning , test case generation , test execution , result validation , adequacy measurement and test report generation , etc. </li></ul><ul><li>Artefact: the files, data, program code and documents etc. inovlved in testing activities. An Artefact possesses an attribute Location expressed by a URL or a URI. </li></ul><ul><li>Method: the method used to perform a test activity . Test methods can be classified in a number of different ways. </li></ul><ul><li>Context: the context in which testing activities may occur in software development stages to achieve various testing purposes. Testing contexts typically include unit testing, integration testing, system testing, regression testing, etc. </li></ul><ul><li>Environment . The testing environment is the hardware and software configurations in which a testing is to be performed. </li></ul>
  25. 26. Structure of basic concepts: Examples Test Activity Test planning Test Case Generation Test Execution Result validation Adequacy measurement Report generation Tester Atomic Service Composite Service
  26. 27. STOWS (2): Compound concepts <ul><li>Capability: describes what a tester can do </li></ul><ul><li>the activities that a tester can perform </li></ul><ul><li>the context to perform the activity </li></ul><ul><li>the testing method used </li></ul><ul><li>the environment to perform the testing </li></ul><ul><li>the required resources (i.e. the input) </li></ul><ul><li>the output that the tester can generate </li></ul>Capability Method Activity Environment Context Capability Data Artefact <<enumeration>> Capability Data Type Input Output 1 1 0-1 0-1 0-* 1-*
  27. 28. <ul><li>Task: describes what testing service is requested </li></ul><ul><li>A testing activity to be performed </li></ul><ul><li>How the activity is to be performed: </li></ul><ul><ul><li>the context </li></ul></ul><ul><ul><li>the testing method to be used </li></ul></ul><ul><ul><li>the environment in which the activity must be carried out </li></ul></ul><ul><ul><li>the available resources </li></ul></ul><ul><ul><li>the expected outcomes </li></ul></ul>Task Method Activity Environment Context Task Data Artefact <<enumeration>> Task Data Type Input Output 0-1 0-1 1 1 1-* 1-*
  28. 29. STOWS (3): Relations between concepts <ul><li>Relationships between concepts are a very important part of the knowledge of software testing: </li></ul><ul><ul><li>Subsumption relation between testing methods </li></ul></ul><ul><ul><li>Compatibility between artefacts’ formats </li></ul></ul><ul><ul><li>Enhancement relation between environments </li></ul></ul><ul><ul><li>Inclusion relation between test activities </li></ul></ul><ul><ul><li>Temporal ordering between test activities </li></ul></ul><ul><li>How such knowledge is used: </li></ul><ul><ul><li>Instances of basic relations are stored in a knowledge-base as basic facts </li></ul></ul><ul><ul><li>Used by the testing broker to search for test services through compound relations </li></ul></ul>
  29. 30. Compound relations <ul><li>MorePowerful relation: between two capabilities. </li></ul><ul><ul><li>MorePowerful ( c 1 , c 2 ) means that a tester has capability c 1 implies that the tester can do all the tasks that can be done by a tester who has capability c 2 . </li></ul></ul><ul><li>Contains relation: between two tasks. </li></ul><ul><ul><li>Contains ( t 1 , t 2 ) means that accomplishing task t 1 implies accomplishing t 2 . </li></ul></ul><ul><li>Matches relation: between a capability and a task. </li></ul><ul><ul><li>Match ( c , t ) means that a tester with capability c can fulfil the task t . </li></ul></ul>Capability Tester MorePowerful * * IsMorePowerful C 2 C 1 Task Contains T 1 T 2 C T Matches Match Contain * * * *
  30. 31. Definition of the MorePowerful relation <ul><li>A capability C 1 is more powerful than C 2 , written MorePowerful (C 1 , C 2 ), if and only if </li></ul><ul><ul><li>C 2 ’s capability is included in C 1 ’s activities </li></ul></ul><ul><ul><li>C 1 and C 2 have the same context. </li></ul></ul><ul><ul><li>Environment of C 1 is the enhancement of the environment of C 2 . </li></ul></ul><ul><ul><li>The method of C 2 is subsumed by C 1 . </li></ul></ul><ul><ul><li>For each input artefact of C 1 , there is a corresponding compatible input in the input artefact of C 2 </li></ul></ul><ul><ul><li>For each output artefact of C 2 there is a corresponding compatible output artefact of C 1 . </li></ul></ul>
  31. 32. Definition of the Contains relation <ul><li>A task T 1 contains task T 2 , written Contains ( T 1 , T 2 ), if and only if </li></ul><ul><ul><li>T 1 and T 2 have the same context, </li></ul></ul><ul><ul><li>T 1 ’s activities include and T 2 ’ s activities, </li></ul></ul><ul><ul><li>The method of T 1 subsumes the method of T 2 , </li></ul></ul><ul><ul><li>The environment of T 2 is an enhancement of the environment of T 1 , </li></ul></ul><ul><ul><li>For each input artefact of T 1 , there is a corresponding compatible the input artefact of T 2 , </li></ul></ul><ul><ul><li>For each output artefact of T 2 , there is a corresponding compatible the output artefact of T 1 . </li></ul></ul>
  32. 33. Definition of the Matches relation <ul><li>A capability C matches a task T , written Matches ( C , T ), if and only if </li></ul><ul><ul><li>C and T have the same context, </li></ul></ul><ul><ul><li>C ’s activities include T ’s activity, </li></ul></ul><ul><ul><li>The method of C subsumes the method of T , </li></ul></ul><ul><ul><li>The environment of T is an enhancement of environment of C , </li></ul></ul><ul><ul><li>For each input artefact of T , there is a corresponding compatible input artefact of C , </li></ul></ul><ul><ul><li>For each output artefact of C, there is a corresponding compatible the output artefact of T . </li></ul></ul>
  33. 34. Properties of the compound relations <ul><li>(1) The relations MorePowerful and Contains are reflexive and transitive. </li></ul><ul><li>(2)  c 1 , c 2  Capability ,  t  Task , </li></ul><ul><li>MorePowerful ( c 1 , c 2 )  Matches ( c 2 , t ) </li></ul><ul><li>Matches ( c 1 , t ). </li></ul><ul><li>(3)  c  Capability ,  t 1 , t 2  Task , </li></ul><ul><li>Contains ( t 1 , t 2 )  Matches ( c , t 1 ) </li></ul><ul><li> Matches ( c , t 2 ). </li></ul>
  34. 35. Prototype implementation <ul><li>Representation of STOWS in OWL </li></ul><ul><ul><li>Both basic and compound concepts are classes in OWL and represented as XML data definition </li></ul></ul><ul><li>Use STOWS in Semantic Web Services </li></ul><ul><ul><li>Compound concepts represented in OWL are transformed into OWL-S Service Profile for registration , discovery and invocation </li></ul></ul><ul><ul><ul><li>UDDI /OWL-S registry server: using OWL-S/UDDI Matchmaker </li></ul></ul></ul><ul><ul><ul><ul><li>The environment: Windows XP, Intel Core Duo CPU 2.16GHz, Jdk 1.5, Tomcat 5.5 and Mysql 5.0. </li></ul></ul></ul></ul>
  35. 36. Transformation of STOWS in OWL-S Activity Context Environment Method Capability data Input Artefacts Output Artefacts ServiceCategory INPUT PARAMETERS ContextMark EnvironmentMark MethodMark Artefacts… OUTPUT PARAMETERS Artefacts… Capability Service profile
  36. 37. Ontology Management <ul><li>Motivation </li></ul><ul><ul><li>All the terms used in the capability description for test service registration and discovery and invocations must be first defined in the ontology. </li></ul></ul><ul><ul><li>However, it is impossible to build a complete ontology of software testing </li></ul></ul><ul><ul><ul><li>the huge volume of software testing knowledge </li></ul></ul></ul><ul><ul><ul><li>the rapid development of new testing technique, methods and tools. </li></ul></ul></ul><ul><ul><li>It is only a framework and has not been attempted to be complete. </li></ul></ul><ul><li>Therefore, the ontology must be extendable and open to the public for updating. </li></ul><ul><ul><li>An ontology management mechanism is provided to enable the population of the ontology </li></ul></ul>
  37. 38. The ontology management mechanism <ul><li>It provides three services to users: </li></ul><ul><ul><li>AddClass: to add new concept </li></ul></ul><ul><ul><li>DeleteClass: to delete concept </li></ul></ul><ul><ul><li>UpdateClass: to revise concept of the ontology </li></ul></ul><ul><li>Restrictions on the manipulation of the data model </li></ul><ul><ul><li>Authority Checker: </li></ul></ul><ul><ul><ul><li>elementary classes </li></ul></ul></ul><ul><ul><ul><ul><li>form the framework of the ontology STOWS. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>None of them could be pruned down </li></ul></ul></ul></ul><ul><ul><ul><li>extended classes </li></ul></ul></ul><ul><ul><ul><ul><li>attached to the elementary classes to define new concepts </li></ul></ul></ul></ul><ul><ul><ul><ul><li>instances of the concepts. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>added by the users and can be deleted from the hierarchy </li></ul></ul></ul></ul><ul><ul><li>Conflict Checker </li></ul></ul><ul><ul><ul><li>the new class to be added does not exist in the ontology </li></ul></ul></ul><ul><ul><ul><li>the class to be deleted has no subclasses in the hierarchy </li></ul></ul></ul>
  38. 39. Structure of OMS
  39. 40. Test brokers <ul><li>A test service that compose existing test services </li></ul><ul><ul><li>Decompose test tasks into subtasks </li></ul></ul><ul><ul><li>Search for test services to carry out the subtasks </li></ul></ul><ul><ul><li>Select test services from candidates </li></ul></ul><ul><ul><li>Coordinate the selected test services </li></ul></ul><ul><ul><ul><li>Invoke them in the right order </li></ul></ul></ul><ul><ul><ul><li>Pass data between them </li></ul></ul></ul><ul><ul><ul><li>Collects test results, etc. </li></ul></ul></ul><ul><li>Itself is a test service as well. </li></ul><ul><li>There may be multiple test brokers owned by different vendors. </li></ul>
  40. 41. Architecture of the prototype test broker We have developed a prototype test broker to demonstrate the feasibility of the approach.
  41. 42. Test broker process model
  42. 43. Case Studies: Overview <ul><li>Case Study 1 : An automated software testing tool CASCAT is wrapped into a test service called TCG </li></ul><ul><li>Case Study 2 : A service specific test service called T-NCS is developed for testing a Web Service that provide Numerical Calculation Services (NCS) </li></ul><ul><li>Case Study 3 : Automated composition of TCG and T-NCS through test broker to perform on-the-fly testing of NCS. </li></ul>
  43. 44. Case study 1: (a) The subject <ul><li>The subject CASCAT: </li></ul><ul><ul><li>Automated component testing tool for EJB </li></ul></ul><ul><ul><li>Generate test cases from algebraic specification written in CASOCC </li></ul></ul><ul><ul><li>Execution of EJB on test cases and reports errors if any axiom in the specification is violated </li></ul></ul>Bo Yu, Liang Kong, Yufeng Zhang, and Hong Zhu, Testing Java Components Based on Algebraic Specifications , Proc. of ICST 2008, April 9-11, 2008, Lillehammer, Norway.  Liang Kong, Hong Zhu and Bin Zhou, Automated Testing EJB Components Based on Algebraic Specifications , Proc. of TEST’07/ COMPSAC’07, Vol. 2, 2007. pp717-722.  
  44. 45. Case study 1: (b) Registry <ul><li>Service Profile of CASCAT </li></ul><ul><ul><li>ServiceCategory: “TestCaseGenerationServices”. </li></ul></ul><ul><ul><li>Input artefact: specified by the class CasoccSpecification , which is a subclass of Specification and stands for algebraic specification in CASOCC. </li></ul></ul><ul><ul><li>Context: “ComponentTest”. </li></ul></ul><ul><ul><li>Environment: ‘not limited’. </li></ul></ul><ul><ul><li>Method is CASOCC-method, which is a subclass of SpecificationBased method. </li></ul></ul><ul><ul><li>Output artefact: test case. </li></ul></ul>
  45. 46. Case study 1: (c) Submitting search requests <ul><li>Test requester: </li></ul><ul><ul><li>a service was built that plays the role of test requester. </li></ul></ul><ul><ul><li>It constructs test tasks and submits them to the test broker to search for a test service </li></ul></ul><ul><ul><li>Test task that it produced is to generate test case from CASOCC specification in the context of the test as component test. </li></ul></ul>
  46. 47. Example of test task <Task rdf:ID=&quot;testcaseTask&quot;> <inputArtefact rdf:resource=&quot;#CasoccSpec&quot;/> <outputArtefact> <TestCase rdf:ID=&quot;testcase&quot;> <Location rdf:datatype=&quot;http://...&quot;> fictitioustestcase.txt </Location> </TestCase> </outputArtefact> <hasActivity> <TestCaseGeneration rdf:ID=&quot;GenerateTestcase&quot;/> </hasActivity> <hasMethod> <CASOCC-method rdf:ID=&quot;CASOCCBasedMethod&quot;/> </hasMethod> <hasContext rdf:resource=&quot;#ComponentTest&quot;/> </Task>
  47. 48. Case study 1. (d) Search and discovery <ul><li>Test Broker: </li></ul><ul><ul><li>Once receives a test task, it generates a capability description from the test task </li></ul></ul><ul><ul><li>Constructs a Service Profile. </li></ul></ul><ul><ul><li>Then calls the API of the Matchmaker Client to search for test service providers. </li></ul></ul>
  48. 49. Case study 1: (e) Invocation <ul><li>A Java Enterprise Bean was deployed on Jboss platform </li></ul><ul><li>A formal specification of the bean was written in CASOCC. </li></ul><ul><li>The web service of CASCAT is invoked as a web service to generate test case of the component. </li></ul><ul><li>The result: </li></ul><ul><ul><li>Test cases as an instance of the OWL class TestCase . </li></ul></ul><ul><ul><li>Stored as a file on a web server </li></ul></ul><ul><ul><li>The Location attribute of the file is returned by the service. </li></ul></ul>
  49. 50. Case study 2: Overview <ul><li>Goal : to develop a test service (T-NCS) that supports testing a Web Service that provide Numerical Calculation Services NCS </li></ul><ul><li>Tasks : </li></ul><ul><ul><li>Registered: </li></ul></ul><ul><ul><ul><li>Capability is described in the ontology represented in OWL-S </li></ul></ul></ul><ul><ul><li>Searchable: </li></ul></ul><ul><ul><ul><li>It can be searched when the testing task matches its capability </li></ul></ul></ul><ul><ul><li>Invoked through the internet </li></ul></ul><ul><ul><ul><li>As a web services to execute test cases on the NCS when invoked </li></ul></ul></ul>
  50. 51. Case study 3: Composition of test services <ul><li>Gaol: </li></ul><ul><ul><li>To automatically discover, select and compose test services on-the-fly using the test broker </li></ul></ul><ul><li>Existing test services: </li></ul><ul><ul><li>TCG : test case generator based on algebraic specification ( developed in case study 1 ) </li></ul></ul><ul><ul><li>T-NCS : test service for executing test cases to test NCS ( developed in case study 2 ) </li></ul></ul><ul><ul><li>TFT : a WS that transforms test cases in the form that TCG produced into test cases that T-NCS recognizes ( developed in case study 3 ) </li></ul></ul><ul><li>Other artefacts available: </li></ul><ul><ul><li>NCS : web services for numerical calculation services </li></ul></ul><ul><ul><li>Algebraic specification of NCS in Casocc language </li></ul></ul>
  51. 52. The process <ul><li>Registration </li></ul><ul><ul><li>The test services are registered to the Matchmaker; </li></ul></ul><ul><li>Submission of test task </li></ul><ul><ul><li>A test task for testing NCS against an algebraic specification is submitted to the test broker; </li></ul></ul><ul><li>Test broker generates a test plan </li></ul><ul><ul><li>Decompose the task into subtasks </li></ul></ul><ul><ul><li>Search for test services for each subtask </li></ul></ul><ul><ul><li>Select a test service for each subtask </li></ul></ul><ul><ul><li>Invoke test services according to the plan and pass data between them </li></ul></ul><ul><li>Test services execute test requests and reports test results </li></ul>
  52. 53. The test task <ul><li><Task rdf:ID=&quot;thirdTask&quot;> </li></ul><ul><li><hasContext> </li></ul><ul><li><ServiceTest rdf:ID=&quot;serviceTest&quot;/> </li></ul><ul><li></hasContext> </li></ul><ul><li> <hasMethod rdf:resource=&quot;#CASOCCMethod&quot;/> </li></ul><ul><li> <hasEnvironment df:resource=&quot;#notLimited&quot;/> </li></ul><ul><li> <hasActivity rdf:resource=&quot;#multiactivites&quot;/> </li></ul><ul><li><inputArtefact> </li></ul><ul><li><CasoccSpecification </li></ul><ul><li>rdf:ID=&quot;casoccSpecification&quot;> </li></ul><ul><li> <Location rdf:datatype= </li></ul><ul><li>&quot; </li></ul><ul><li>/XMLSchema#anyURI&quot;> </li></ul><ul><li>http://.../specification/Calculator.asoc </li></ul><ul><li> </Location> </li></ul><ul><li></CasoccSpecification> </li></ul><ul><li></inputArtefact> </li></ul><outputArtefact> <TestCase rdf:ID=&quot;testcase&quot;> <Location rdf:datatype= &quot; XMLSchema#anyURI&quot;> http://.../artefacts/testcase/ fictitioustestcase.txt </Location> </TestCase> </outputArtefact> <testObject> <TestObject rdf:ID=&quot;calculateService&quot;> <operationName rdf:datatype= &quot; XMLSchema#string&quot;> add </operationName> <endpoint rdf:datatype=&quot; 2001/XMLSchema#string&quot;> http://.../axis/services/CalculatorImpl </endpoint> </TestObject> </testObject> </Task>
  53. 54. Subtasks and selected test services <ul><li>Subtask 1 : Generation of test cases </li></ul><ul><ul><li>Input Artefact : http://.../specification/Calculator.asoc </li></ul></ul><ul><ul><li>Tester profile : http://../casestudy/third/generateTestcase.owl#generateTestcaseProfile </li></ul></ul><ul><ul><li>Result : http://../testcase/testcases.log </li></ul></ul><ul><li>  Subtask 2 : Transformation of test cases from Casocc format to NCS test case format </li></ul><ul><ul><li>Input Artefact : http://../testcase/testcases.log </li></ul></ul><ul><ul><li>Tester profile : http://../casestudy/third/transformer.owl#transformerProfile </li></ul></ul><ul><ul><li>Result : http://../testcase/calculatortestcase.xml </li></ul></ul><ul><li>  Subtask 3 : Execution on test cases </li></ul><ul><ul><li>Input Artefact : http://../testcase/calculatortestcase.xml </li></ul></ul><ul><ul><li>Tester profile : http://../casestudy/third/executeTestcase.owl#executeTestcaseProfile </li></ul></ul><ul><ul><li>Result : http://../testresult/testresult.xml </li></ul></ul>
  54. 55. Conclusion <ul><li>Testing imposes challenges to testing web services applications are analysed: </li></ul><ul><ul><li>Testing a web service as own software </li></ul></ul><ul><ul><ul><li>Mostly solvable by adaption of existing software technologies </li></ul></ul></ul><ul><ul><li>Integration testing at development and at run-time </li></ul></ul><ul><ul><ul><li>No support in current WS standard stack </li></ul></ul></ul><ul><ul><ul><li>Grant challenge to existing software testing technology </li></ul></ul></ul><ul><ul><ul><ul><li>The lack of software artifacts </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The Lack of control over test executions </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The Lack of means of observation on internal behaviours </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The need to deal with diversity </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The need of testing on-the-fly </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The need of non - intrusive testing </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The need of automation </li></ul></ul></ul></ul>
  55. 56. Related works <ul><li>Tsai et al . (2004): a framework to extend the function of UDDI to enable collaboration </li></ul><ul><ul><li>Check-in and check-out services to UDDI servers </li></ul></ul><ul><ul><ul><li>a service is added to UDDI registry only if it passes a check-in test. </li></ul></ul></ul><ul><ul><ul><li>A check-out testing is performed every time the service is searched for. It is recommended to a client only if it passes the check-out test. </li></ul></ul></ul><ul><ul><ul><li>To facilitate such tests, they require test scripts being included in the information registered for the WS on UDDI. </li></ul></ul></ul><ul><ul><li>Group testing: further investigation of the problem how to select a service from a large number of candidates by testing. </li></ul></ul><ul><ul><ul><li>a test case ranking technique to improve the efficiency of group testing. </li></ul></ul></ul><ul><li>Bertolino et al (2005): audition framework </li></ul><ul><ul><li>an admission testing when a WS is registered to UDDI </li></ul></ul><ul><ul><li>run time monitoring services on both functional and non-functional behaviours after a service is registered in a UDDI server, </li></ul></ul><ul><ul><li>Service test governance (STG) (2009): </li></ul></ul><ul><ul><ul><li>to incorporate testing into a wider context of quality assurance of WS </li></ul></ul></ul><ul><ul><ul><li>imposing a set of policies, procedures, documented standards on WS development, etc. </li></ul></ul></ul>Bertolino and Polini admitted (2009), “ on a pure SOA based scenario the framework is not applicable ”. Both recognised the need of collaboration in testing WS, the technical details about how to collaborate multiple parties in WS testing was left open.
  56. 57. Advantages of proposed approach <ul><li>Feasibility </li></ul><ul><ul><li>tested by case studies with the prototype implementation </li></ul></ul><ul><li>Practical usability: </li></ul><ul><ul><li>Implementable without any change to the existing standards of Semantic WS </li></ul></ul><ul><li>Motivation for wider adoption by industry </li></ul><ul><ul><li>Business opportunities for testing tool vendors and software testing companies to provide testing services online as web services </li></ul></ul><ul><li>Scalable </li></ul><ul><ul><li>test services are distributed and there is no extra-burden on UDDI servers. </li></ul></ul><ul><li>Dealing with variety </li></ul><ul><ul><li>collaborations among many test services </li></ul></ul><ul><ul><li>the employment of ontology of software testing to integrate multiple testing tools. </li></ul></ul><ul><li>Testing on-the-fly, </li></ul><ul><ul><li>The automation of the dynamic composition of test services achieved by employing an ontology of software testing </li></ul></ul><ul><li>No interfere with the normal operations of the services </li></ul><ul><ul><li>running a separate test services </li></ul></ul><ul><li>Access to documents with proper intellectual property protection </li></ul><ul><ul><li>using trusted third party of professional test services </li></ul></ul>
  57. 58. Remaining challenges and future work <ul><li>Technical challenges </li></ul><ul><ul><li>To populate the ontology of software testing (e.g. the formats of many different representations of testing related artefacts) </li></ul></ul><ul><ul><li>To improve the test broker </li></ul></ul><ul><ul><li>To device the mechanism of certification and authentication for testing services </li></ul></ul><ul><li>Social challenges </li></ul><ul><ul><li>For the above approach to be practically useful, it must be adopted by web service developers, testing tool vendors and software testing companies </li></ul></ul>
  58. 59. References <ul><li>Zhang, Y. and Zhu, H., Ontology for Service Oriented Testing of Web Services , Proc. of The Fourth IEEE International Symposium on Service-Oriented System Engineering (SOSE 2008) , Dec. 18-19, 2008, Taiwan. </li></ul><ul><li>Zhu, H., A Framework for Service-Oriented Testing of Web Services , Proc. of COMPSAC’06, Sept. 2006, pp679-691. </li></ul><ul><li>Zhu, H. and Huo, Q., Developing A Software Testing Ontology in UML for A Software Growth Environment of Web-Based Applications , Chapter IX: Software Evolution with UML and XML, Hongji Yang (ed.). IDEA Group Inc. 2005, pp263-295. </li></ul><ul><li>Zhu, H. Cooperative Agent Approach to Quality Assurance and Testing Web Software , Proc. of QATWBA’04/COMPSAC’04, Sept. 2004, IEEE CS, Hong Kong,pp110-113. </li></ul><ul><li>Zhu, H., Huo, Q. and Greenwood, S., A Multi-Agent Software Environment for Testing Web-based Applications , Proc. of COMPSAC’03, 2003, pp210-215. </li></ul>