A Framework for Contract-Based Collaborative Verification and Validation of Web Services Xiaoying Bai Department of Computer Science and Technology Tsinghua University
[email protected] 2007.7
Outline Research motivation and background The test broker architecture for Decentralized Collaborative Verification and Validation (DCV&V) DCV&V contracts Contract-Based test generation Conclusion 10/7/2007
CBSE'07, July 9-12 2007
2
Motivation Service-Oriented Architecture (SOA) and its implementation Web Services (WS) are redefining the entire process of software development.
Software delivery, discovery, composition, collaboration
Organization A
Organization B
Organization C
+
t1 Setup
WS1 WS2 10/7/2007
+
t5 t2
t3
t4
Prepare Sample
Prepare Clones and Sequence
Assembly
WS3
t6
t7
Test Quality Get Sequences Sequence Processing
WS7
WS4 July 9-12 2007 CBSE'07,
WS5
WS9
t8 Process Report
WS8
WS6
3
Motivation Standard-based dynamic collaboration is a key feature of WS systems.
10/7/2007
CBSE'07, July 9-12 2007
4
Motivation Trustworthiness is a big challenge for dynamic collaboration.
The success of WS depends on its capability to resolve the testing issues. (Bloomberg 2002)
"Web services are not yet widely used because of security concerns. But there's an even bigger roadblock waiting just down the road -- it's called trust. The big issue is 'Will the service work correctly every time when I need it?' As yet few are thinking about the issues of testing and certification. We suggest that testing and certification of Web services is not business as usual and that new solutions are needed to provide assurance that services can really be trusted." -- In CBDi Forum, 11 Jul 2002 10/7/2007
CBSE'07, July 9-12 2007
5
Motivation New challenges for WS testing
Assessment of a large number of services Large number of services meeting the same specification could be
available over the open Internet platform
Dynamic testing and automated testing The dynamically constructed application has to be tested
dynamically at runtime automatically without human intervention following the specification-based approach.
Cooperative testing The distributed architecture requires cooperation and collaboration
among different testing activities and stakeholders including service provider, service consumer, and service brokers. 10/7/2007
CBSE'07, July 9-12 2007
6
WS Collaborative Verification and Validation (CV&V)
WebStrar Infrastructure
Service brokers: Service developers/providers: To enable the collaboration anddatabase, cooperation Access tools, and composeof newall WS the Submit WS + test cases + test case oracle parties involved in SOA to perform WS testing. Test case Model WebStrar testing services and WS Testing Infrastructure Master Test for case database generators checking service-based applications WSDL WS Reliability Test case Oracle Test case OWL-S models ranking models generators validation TheReliability trustworthy service broker DAML-S database
Extend UDDI by adding just-in-time WS testing, Service WSserver ranking models Local or remote composition evaluation, and ranking capabilities. WS directory
Service Requestors/ Clients 10/7/2007
Policy & Standards
Trustworthy WS repository
Composite WS
Validation
Researchers and regulators: Analyze data, monitor quality, and dynamically replace models and tools CBSE'07, July 9-12 2007
7
The Test Broker Architecture for CV&V Test Provider
7
4
Tester 6
1
3
2 8 Test Broker
5
Service Broker
9
10
10/7/2007
Service User
CBSE'07, July 9-12 2007
Service Provider
8
The Test Broker Architecture for CV&V The test provider can be Service provider Service requester Independent tester
10/7/2007
The tester can be Service provider Service requester Service broker Certification organization Independent tester
CBSE'07, July 9-12 2007
9
The Test Broker Data Structure Test Broker
Service Broker
TestEntity
BusinessEntity
TestCase TestBinding
BusinessService TestModel
ServiceLinking
tModel
BindingTemplate
tModel
BindingTemplate BusinessService
TestCase TestBinding
TestModel
tModel
BindingTemplate
tModel
BindingTemplate
ServiceLinking
10/7/2007
CBSE'07, July 9-12 2007
10
The Test Broker Services Test Broker Test Submission
Test Repository 10/7/2007
Test Case Management
Test Query
Defect Management
Test Generation
Test Profile Management Evaluation Management
Test Collaboration Test Evaluation
CheckInTest CheckOutTest GenerateTest QueryTest RunTest ServiceEvaluation TestEvaluation
Service Evaluation CBSE'07, July 9-12 2007
11
Decentralized Test Brokers Multiple loosely coupled test brokers distributed in the Internet environment. Each test broker may be dedicated to different V&V tasks or target domains. Enable scalable and flexible collaboration among test participants. A broker can flexibly join or quit the collaboration. Collaborations can be established at runtime through negotiation. 10/7/2007
CBSE'07, July 9-12 2007
12
DCV&V Contracts TSC: Testing Service Contracts – Collaboration between test and service under test Test designers get service specification for test generation. Test executors exercise the test on the service interface. Test evaluators evaluate the service based on test results and defect reports.
TCC: Test Collaboration Contracts – Collaboration among test participants
10/7/2007
Protocols for collaborative test design, execution, and evaluation. CBSE'07, July 9-12 2007
13
Test Collaboration Contract Test Design Test Case Test Scenario
Test Scheduling Test Plan Test Run
Test Execution
) 5 !"#$ -.)
6
!"#$ '()&*+, )
5
5
6 6 5 5
5 ) )
) )
)
Test Result
6
Defect
!"#$ 7/&)
Test Evaluation
)
!"#$ %"
)
) ) !"#$ -"#./$
0"1"($ 6
5
) 6
)
-"/+&2 3+/+$4
Reliability 10/7/2007
CBSE'07, July 9-12 2007
14
Contract-Based Test Generation OWL-S specification OWL-S introduces Ontology into service
representation to improve the mutual comprehension of the operation semantics. ServiceModel models the service composition as a workflow of processes. A composite process holds a Control Construct An atomic process represents a service with IOPE (Input, Output, Precondition, Effect) 10/7/2007
CBSE'07, July 9-12 2007
15
Contract-Based Test Generation Test Process generation based on Petri-Net model Petri-Net model has a strong capability to model events and states in a distributed system and to capture sequential, concurrency and event-based control. OWL-S processes are mapped to a Petri-Net model. Petri-Net provides powerful support for analyzing and verifying certain properties such like reachability, liveness, and deadlocks. Based on the Petri-Net topology, test processes are generated to cover various execution paths.
10/7/2007
CBSE'07, July 9-12 2007
16
Contract-Based Test Generation Constraint-guided test generation WSDL data constraints based on XML schema E.g. {length = ”5”, pattern = ”[A − Z]{2}[0 − 9]{3}”}. OWL-S preconditions
10/7/2007
CBSE'07, July 9-12 2007
17
Contract-Based Test Generation Process constraints
10/7/2007
CBSE'07, July 9-12 2007
18
The Prototype System Service Spec WSDL
Spec Analysis
Modeling
BPEL Model Checking
OWL-S
Test Agent
Test Generation
Adaptive Strategy Selection
Controller
Result Analysis
测试驱动 Driver
Service & Service Composition 10/7/2007
测试监控 Monitor CBSE'07, July 9-12 2007
19
The Prototype System
10/7/2007
CBSE'07, July 9-12 2007
20
Conclusion A test broker architecture is proposed and the prototype system is being developed. The test broker enables collaborations among test participants The test broker collaborates with the service broker to enforce runtime service testing and evaluation The test brokers are loosely coupled and decentralized to enhance scalability. They can dynamically establish collaboration.
The contracts for broker-based test collaboration is analyzed including TCC and TSC. The contract-based automatic testing is discussed. 10/7/2007
CBSE'07, July 9-12 2007
21