Collaborative Testing of Web Services: - The Service Oriented Framework and Implementation in Semantic WS
Collaborative Testing of Web Services: - The Service Oriented Framework and Implementation in Semantic WS
Collaborative Testing of Web Services: - The Service Oriented Framework and Implementation in Semantic WS
Acknowledgement
Sept. 8, 2008
Mr. Yufeng Zhang, MSc student at the National University of Defence Technology, China Mr. Qingning Huo, PhD student at Oxford Brookes University, UK Dr. Sue Greenwood, Oxford Brookes University, UK
Overview
Analyse
the impact of the novel features of service-orientation on software testing Identify the grant challenges in testing WS applications Propose an framework to support testing WS Report on prototype implementation of the framework and case studies Compare with related works and discussion of future work
Seminar at Tsinghua University 3
Sept. 8, 2008
Sept. 8, 2008
Web services is a distributed computing technique that offers more flexibility and looser coupling so that it is more suitable for internet computing. The dominant of program-to-program interactions
WS technique stack
Basic standards:
WSDL: service description and publication UDDI: for service registration and retrieval SOAP for service invocation and delivery
Sept. 8, 2008
More advanced standards for collaborations between service providers and requesters.
BPEL4WS: business process and workflow models. OWL-S: ontology for the description of semantics of services
Registry
Search for services registered services request service
deliver service
register service
Requester
Provider
5
A typical scenario
Car Insurance Broker
Suppose that a fictitious car insurance broker CIB is developing a webbased system that provides a complete service of car insurance.
Sept. 8, 2008
End users:
Submit
car insurance requirements to CIB Get quotes from various insurers Select one insurer to insure the car Submit payment information Get insurance document//confirmation
Broker:
Take
information about the user and the car Check the validity of users information Get quotes from insurers and pass them to the user Get users selection of the insurer Get insurance from the insurer and pass the payment to the selected insurer Take commissions from the insurer or the user
Sept. 8, 2008
Bank Bs Services
Insurance A1s Services
CIBs Services
WS Registry
Should be dynamically integrated for business flexibility and competence, and lower operation and maintenance cost
Seminar at Tsinghua University 7
Similar to test software components. Many existing work on software component testing can be applied or adapted with special considerations:
Sept. 8, 2008
The stateless feature of HTTP protocol; XML encoding of the data passing between services as in SOAP standard; Confirmation to the published descriptions:
WSDL for the syntax of the services workflow specification in BPEL4WS semantic specification in e.g. OWL-S.
Progresses on these issues have been made in the past few years
Seminar at Tsinghua University 8
Sept. 8, 2008
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 requesters software system due to fault. Burdens are on the testers to ensure that the system handles such abnormal behaviours properly. As all web-based applications, load balance is essential. But, the knowledge of the usage of a WS may not be available during the design and implementation of the system. 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. 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.
Sept. 8, 2008
of software artifacts Lack of control over test executions Lack of means of observation on system behaviour
10
The problem: No design documents, No source code, No executable code The impacts:
For statically bound services, Techniques that automatically derive stubs from source code are not applicable Automatic instrumentation of original source code or executable code is not applicable For dynamic bound services, Human involvement in the integration becomes completely impossible.
Sept. 8, 2008
Possible solutions:
(a) Derive test harness from WS descriptions; (b) The service provider to make the test stubs and drivers available for integration.
11
Problem:
Services are typically located on a computer on the Internet that testers have no control over its execution. Control over the execution has been essential to apply existing testing techniques and will continue to be essential for testing services: An invocation of the service as a test must be distinguished from a real request of the service. System may be need to be restarted or put into a certain state to test it. The situation could become much more complicated when a WS is simultaneously tested by many service requesters.
Sept. 8, 2008
Impact:
Possible solution:
The service provider must provide a mechanism and a service that enable service requesters control the testing executions of the service.
The problem:
A tester cannot observe the internal behaviours of the services No way to measure test coverage
Sept. 8, 2008
The Impacts:
Possible solutions:
The service provider provides a mechanism and the services to the outside tester to observe its softwares internal behaviour in order to achieve the test adequacy that a service requester requires. 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.
Seminar at Tsinghua University 13
the parts may operate on a variety of the hardware and software platforms different deployment configurations delivering different quality of services. A typical scenario of service oriented
testing just before the invocation
computing is that a service requester searches for a required function in a registry, and then dynamically links to the service and invokes it.
Sept. 8, 2008
Consequences of testing on-the-fly: The need of non-intrusive testing: the test invocations of a service must be distinguished from the real ones
service provider: the normal operation of the service must not disturbed by test activities. client: do not actually receive the real services and do not incur the cost
14
The problem
The need to deal with diversity testing must be performed in a heterogeneous environment. different service requesters may well have different test requirements to meet their own business purposes Universal powerful testing tools: expensive if not impossible Collaboration and integration of a variety of tools
Sept. 8, 2008
The Implications
Possible solutions
15
Testing on-the-fly
The
problem
Test
Sept. 8, 2008
Implications
human
solutions
16
functional services: the services of the original functionality testing services: the services to enable test the functional services.
Sept. 8, 2008
Testing services can be either provided by the same vendor of the functional services, or by a third party. Independent testing services:
Provider: testing tool vendors companies of specialized in software testing The services: to generate test cases, to measure test adequacy, to extract various types of diagrams from source code or design and specification documents, etc.
17
Sept. 8, 2008
18
Sept. 8, 2008
19
Sept. 8, 2008
Information about the car and the user Car Insurance Broker CIB Insurance quotes
customer
20
Matchmaker 4.Search for testers 5. List of testers 3.Request test Car Insurance service Test Broker: TB Broker CIB 16.Test report 6.Request 15.Test Intended composition 9.Test test service results of services case 10.Request test service Insurer Web Service IS 1.Register 7.Request service (F-Service) Testing Service: service meta-data TG (Test case Generator) 2.Register 8.Testing related Insurer Web service meta-data Service: IS (T-Service) 11.Request service Testing Service: TE meta-data (Test Executor) 12.Testing related meta-data 13.Test invocation of services
Seminar at Tsinghua University of services 14.Results of test invocation 21
Sept. 8, 2008
Sept. 8, 2008
22
How a testing service should be described, published and registered at WS registry; How a testing service can be retrieved automatically even for testing dynamically bound services; 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. How testing results can be summarized and reported in the forms that are suitable for both human beings to read and machine to understand.
Sept. 8, 2008
These issues can be resolved by the utilization of a software testing ontology (Zhu & Huo 2003, 2005).
Seminar at Tsinghua University 23
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 STOWS is base on an ontology of software testing originally developed for agent oriented software testing (Zhu & Huo 2003, 2005). The concepts of software testing are divided into two groups. Knowledge about software testing are also represented as relations between concepts
Seminar at Tsinghua University 24
Sept. 8, 2008
Tester: a particular party who carries out a testing activity. 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. 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. Method: the method used to perform a test activity. Test methods can be classified in a number of different ways. 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. Environment. The testing environment is the hardware and software configurations in which a testing is to be performed.
Seminar at Tsinghua University 25
Sept. 8, 2008
Sept. 8, 2008
Atomic Service
Composite Service
Test planning
Test Case Generation Test Execution
Test Activity
Result validation
Adequacy measurement
Report generation
Seminar at Tsinghua University 26
Sept. 8, 2008
the activities that a tester can perform the context to perform the activity the testing method used the environment to perform the testing the required resources (i.e. the input) the output that the tester can generate
Seminar at Tsinghua University
27
Task:
1 Activity
Sept. 8, 2008
0-1 Context
A testing activity to be performed How the activity is to be performed: the context the testing method to be used the environment in which the activity must be carried out the available resources the expected outcomes
Seminar at Tsinghua University
28
Relationships between concepts are a very important part of the knowledge of software testing:
Subsumption relation between testing methods Compatibility between artefacts formats Enhancement relation between environments Inclusion relation between test activities Temporal ordering between test activities
Sept. 8, 2008
Instances of basic relations are stored in a knowledge-base as basic facts Used by the testing broker to search for test services through compound relations
29
Compound relations
MorePowerful(c1, c2) means that a tester has capability c1 implies that the tester can do all the tasks that can be done by a tester who has capability c2. Contains(t1, t2) means that accomplishing task t1 implies accomplishing t2. Match(c, t) means that a tester with capability c can fulfil the task t. Tester
Sept. 8, 2008
* C1 IsMorePowerful
MorePowerful
* C2
Capability
C Matches T * *
Match
T2 Task * * T1 Contains
Contain
30
Definition of the MorePowerful relation A capability C1 is more powerful than C2, written MorePowerful(C1, C2), if and only if C2s capability is included in C1s activities
Sept. 8, 2008
C1
and C2 have the same context. Environment of C1 is the enhancement of the environment of C2. The method of C2 is subsumed by C1. For each input artefact of C1 , there is a corresponding compatible input in the input artefact of C2 For each output artefact of C2 there is a corresponding compatible output artefact of C1.
Seminar at Tsinghua University 31
Definition of the Contains relation A task T1 contains task T2, written Contains(T1, T2), if and only if
T1
Sept. 8, 2008
and T2 have the same context, T1s activities include and T2s activities, The method of T1 subsumes the method of T2, The environment of T2 is an enhancement of the environment of T1, For each input artefact of T1, there is a corresponding compatible the input artefact of T2, For each output artefact of T2 , there is a corresponding compatible the output artefact of T1.
Seminar at Tsinghua University 32
and T have the same context, Cs activities include Ts activity, The method of C subsumes the method of T, The environment of T is an enhancement of environment of C, For each input artefact of T , there is a corresponding compatible input artefact of C, For each output artefact of C, there is a corresponding compatible the output artefact of T.
Seminar at Tsinghua University 33
Prototype implementation
Representation
Both
Sept. 8, 2008
of STOWS in OWL
basic and compound concepts are classes in OWL and represented as XML data definition
Use
Compound
concepts represented in OWL are transformed into OWL-S Service Profile for registration, discovery and invocation
UDDI /OWL-S registry server: using OWL-S/UDDI Matchmaker The environment: Windows XP, Intel Core Duo CPU 2.16GHz, Jdk 1.5, Tomcat 5.5 and Mysql 5.0.
Seminar at Tsinghua University 35
Capability
ServiceCategory
Service profile
Sept. 8, 2008
INPUT PARAMETERS
OUTPUT PARAMETERS
Artefacts
36
Ontology Management
Motivation
Sept. 8, 2008
All the terms used in the capability description for test service registration and discovery and invocations must be first defined in the ontology. However, it is impossible to build a complete ontology of software testing
the huge volume of software testing knowledge the rapid development of new testing technique, methods and tools.
Therefore, the ontology must be extendable and open to the public for updating.
AddClass: to add new concept DeleteClass: to delete concept UpdateClass: to revise concept of the ontology Authority Checker:
elementary classes form the framework of the ontology STOWS. None of them could be pruned down extended classes attached to the elementary classes to define new concepts instances of the concepts. added by the users and can be deleted from the hierarchy
Sept. 8, 2008
Conflict Checker
the new class to be added does not exist in the ontology the class to be deleted has no subclasses in the hierarchy
Seminar at Tsinghua University
38
Structure of OMS
Sept. 8, 2008
39
Test brokers
A
Decompose
Sept. 8, 2008
test tasks into subtasks Search for test services to carry out the subtasks Select test services from candidates Coordinate the selected test services
Invoke them in the right order Pass data between them Collects test results, etc.
Itself
is a test service as well. There may be multiple test brokers owned by different vendors.
Seminar at Tsinghua University 40
41
Test Report
If Empty
If no alternative T-service
Select a T-service
Selected T-Services
Set Profile parameters according to Task Select An Alternative T-Service Report Test Results to The User
Test Results
If successful
42
Sept. 8, 2008
component testing tool for EJB Generate test cases from algebraic specification written in CASOCC Execution of EJB on test cases and reports errors if any axiom in the specification is violated
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 TEST07/ COMPSAC07, Vol. 2, 2007. pp717-722.
Seminar at Tsinghua University 44
Profile of CASCAT
ServiceCategory:
Sept. 8, 2008
TestCaseGenerationServices. Input artefact: specified by the class CasoccSpecification, which is a subclass of Specification and stands for algebraic specification in CASOCC. Context: ComponentTest. Environment: not limited. Method is CASOCC-method, which is a subclass of SpecificationBased method. Output artefact: test case.
Seminar at Tsinghua University 45
requester:
service was built that plays the role of test requester. It constructs test tasks and submits them to the test broker to search for a test service Test task that it produced is to generate test case from CASOCC specification in the context of the test as component test.
46
Sept. 8, 2008
47
Broker:
Once
Sept. 8, 2008
receives a test task, it generates a capability description from the test task Constructs a Service Profile. Then calls the API of the Matchmaker Client to search for test service providers.
48
A Java Enterprise Bean was deployed on Jboss platform A formal specification of the bean was written in CASOCC. The web service of CASCAT is invoked as a web service to generate test case of the component. The result:
Sept. 8, 2008
Test cases as an instance of the OWL class TestCase. Stored as a file on a web server The Location attribute of the file is returned by the service.
49
Sept. 8, 2008
Goal: to develop a test service (T-NCS) that supports testing a Web Service that provide Numerical Calculation Services NCS Tasks:
Registered:
Capability is described in the ontology represented in OWL-S
Searchable:
It can be searched when the testing task matches its capability
50
Gaol:
To automatically discover, select and compose test services on-the-fly using the test broker TCG: test case generator based on algebraic specification (developed in case study 1) T-NCS: test service for executing test cases to test NCS (developed in case study 2) 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) NCS: web services for numerical calculation services Algebraic specification of NCS in Casocc language
Seminar at Tsinghua University 51
Sept. 8, 2008
The process
Registration
The test services are registered to the Matchmaker; A test task for testing NCS against an algebraic specification is submitted to the test broker;
Sept. 8, 2008
Decompose the task into subtasks Search for test services for each subtask Select a test service for each subtask Invoke test services according to the plan and pass data between them
<outputArtefact> <TestCase rdf:ID="testcase"> <Location rdf:datatype= "http://www.w3.org/2001/ XMLSchema#anyURI"> http://.../artefacts/testcase/ fictitioustestcase.txt </Location> </TestCase> </outputArtefact> <testObject> <TestObject rdf:ID="calculateService"> <operationName rdf:datatype= "http://www.w3.org/2001/ XMLSchema#string"> add </operationName> <endpoint rdf:datatype="http://www.w3.org/ 2001/XMLSchema#string"> http://.../axis/services/CalculatorImpl </endpoint> </TestObject> </testObject> </Task>
Sept. 8, 2008
53
Sept. 8, 2008
Subtask 2: Transformation of test cases from Casocc format to NCS test case format
Input Artefact: http://../testcase/testcases.log Tester profile: http://../casestudy/third/transformer.owl#transformerProfile Result: http://../testcase/calculatortestcase.xml Input Artefact: http://../testcase/calculatortestcase.xml Tester profile: http://../casestudy/third/executeTestcase.owl#executeTestcaseProfile Result: http://../testresult/testresult.xml
Seminar at Tsinghua University 54
Conclusion
Sept. 8, 2008
55
Related works
Bertolino and Polini admitted (2009), on a pure SOA based scenario the framework is not applicable.
Tsai et al. (2004): a framework to extend the function of UDDI to enable collaboration
Check-in and check-out services to UDDI servers
a service is added to UDDI registry only if it passes a check-in test. 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. To facilitate such tests, they require test scripts being included in the information registered for the WS on UDDI.
Sept. 8, 2008
Group testing: further investigation of the problem how to select a service from a large number of candidates by testing.
a test case ranking technique to improve the efficiency of group testing.
an admission testing when a WS is registered to UDDI run time monitoring services on both functional and non-functional behaviours after a service is registered in a UDDI server, Service test governance (STG) (2009):
to incorporate testing into a wider context of quality assurance of WS imposing a set of policies, procedures, documented standards on WS development, etc.
Both recognised the need of collaboration in testing WS, the technical details about how to collaborate multiple parties in WS testing was left open.
Seminar at Tsinghua University 56
Feasibility
collaborations among many test services the employment of ontology of software testing to integrate multiple testing tools.
Testing on-the-fly,
The automation of the dynamic composition of test services achieved by employing an ontology of software testing
populate the ontology of software testing (e.g. the formats of many different representations of testing related artefacts) To improve the test broker To device the mechanism of certification and authentication for testing services
Social
For
challenges
the above approach to be practically useful, it must be adopted by web service developers, testing tool vendors and software testing companies
Seminar at Tsinghua University 58
References
Sept. 8, 2008
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. Zhu, H., A Framework for Service-Oriented Testing of Web Services, Proc. of COMPSAC06, Sept. 2006, pp679-691. 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. Zhu, H. Cooperative Agent Approach to Quality Assurance and Testing Web Software, Proc. of QATWBA04/COMPSAC04, Sept. 2004, IEEE CS, Hong Kong,pp110-113. Zhu, H., Huo, Q. and Greenwood, S., A Multi-Agent Software Environment for Testing Web-based Applications, Proc. of COMPSAC03, 2003, pp210-215.
Seminar at Tsinghua University 59