Download presentation
Presentation is loading. Please wait.
Published byKailee Marton Modified over 10 years ago
1
Generating test cases specifications for BPEL compositions of web services using SPIN José García-Fanjul, Javier Tuya, and Claudio de la Riva Pointner Stefan 13.01.2014 Pointner StefanAK Softwaretechnologie 1 WS 2013/141
2
Contents Introduction Specification of web services compositions with BPEL Overview of the generation of test cases specifications Transforming BPEL specifications into PROMELA Using SPIN to generate test case specifications Conclusion AK Softwaretechnologie 1 WS 2013/142Pointner Stefan
3
Introduction Web as a Commercial Channel Certain exchange protocol XML Software with XML as Input and Output XML based Web Services Distributed Asynchronous Platform independent Low coupled Pointner StefanAK Softwaretechnologie 1 WS 2013/143
4
Introduction Compositions of Web Services Business Process Execution Language (BPEL) Testing Web Services Asynchronous behavior Distribution Availability Lack of user Interface Pointner StefanAK Softwaretechnologie 1 WS 2013/144
5
Specification of WS with BPEL XML-Documents Declarations Specifications Declarations Partners Variables Specification Basic Activities (Assign, Invoke, Receive) Structured Activities (Sequence, Flow, While) Pointner StefanAK Softwaretechnologie 1 WS 2013/145
6
BPEL Example Pointner StefanAK Softwaretechnologie 1 WS 2013/146
7
<variable name="riskAssessment" messageType="asns:riskAssessmentMessage"/> [...] [...] [...]... Pointner StefanAK Softwaretechnologie 1 WS 2013/147
8
<invoke name="invokeAssessor" partner="assessor" portType="asns:riskAssessmentPT" operation="check" inputVariable="request" outputVariable="riskAssessment"> <source linkName="assess-to-setMessage" transitionCondition= "bpws:getVariableData(riskAssessment, risk)=low"/> <source linkName="assess-to-approval" transitionCondition=" bpws:getVariableData(riskAssessment, risk)!=low"/> [...] Pointner StefanAK Softwaretechnologie 1 WS 2013/148
9
Business Process Pointner StefanAK Softwaretechnologie 1 WS 2013/149
10
Test case specification generation Simple Promela Interpreter – SPIN LTL Formulae used for Property-specification How it works? SPIN searches all possible states within the model Checks whether the properties hold If not gives a Counter Example Generate Test Cases with SPIN Transform Counter Example to Test Cases Process/Protocol Meta Language – PROMELA Describes models of distributed Systems Pointner StefanAK Softwaretechnologie 1 WS 2013/1410
11
Test case specification generation 1.Composition Under Test (CUT) is transformed into PROMELA 2.Transitions are identified 3.Mapping Transitions onto the Model 4.Transition expressed as LTL Property 5.Run SPIN with the Model and the Input LTL-Properties 6.Generate Test Cases with the produced Counter Example Pointner StefanAK Softwaretechnologie 1 WS 2013/1411
12
Test case specification generation Pointner StefanAK Softwaretechnologie 1 WS 2013/1412
13
Transforming BPEL specifications into PROMELA PROMELA also includes BPEL-partners BPEL portTypes transformed to PROMELA message channels chan loanassessor_riskPort_IN = [QLENGTH] of {byte, byte, byte}; Input and Output channel Message Types are declared as typedefs Invoke Activity = ! Receive Activity = ? Pointner StefanAK Softwaretechnologie 1 WS 2013/1413
14
Transforming BPEL specifications into PROMELA - Example BPEL_loanApprovalPort_OUT! approvalInfo.accept Sends a message containing the variable approvalInfo.accept to channel BPEL_loanApprovalPort_OUT Pointner StefanAK Softwaretechnologie 1 WS 2013/1414
15
Transforming BPEL specifications into PROMELA – Web Service If the BPEL specification has no reference to the data, it will be given an undefined value If the data is compared to a numerical constant, it will be given the value of the constant, a lower value and a higher third value If the data is discrete, it will be given each of the discrete constants in the BPEL specification and a value different from them, called other Pointner StefanAK Softwaretechnologie 1 WS 2013/1415
16
Transforming BPEL specifications into PROMELA – Transitions BPEL is modelled in PROMELA transitions are identified in the specification and are mapped within the model Implicit Transitions Invoke Flow While Explicit Transitions Are identified from link constructs Explicitly transitions between activities (with same source or target) Pointner StefanAK Softwaretechnologie 1 WS 2013/1416
17
Transition expressed as LTL Property Unique Boolean variables tran1, tran2, tran3, … Variable will get true in case of the transition being exercised by the model checker The variable associated with a transition X is always false [] !tranX Test Case stop if the property tranX is false To get to end, change property to: [] ( !tranX || !bpel_ends) Pointner StefanAK Softwaretechnologie 1 WS 2013/1417 Using SPIN to generate test case specifications
18
LTL property: [] ( !tran1 || !bpel_ends) Example CounterExample for Transition 1, 3, 5: customer: request.amount = 3 customer: BPEL_loanApprovalPort_IN!request bpel: request.amount<4 bpel: tran1 = true bpel: loanassessor_riskAssessmentPort_IN!request assessor: riskAssessment.risk = low assessor: loanassessor_riskAssessmentPort_OUT! riskAssessment bpel: tran3 = true bpel: approvalInfo.accept = yes bpel: tran5 = true bpel: BPEL_loanApprovalPort_OUT!approvalInfo bpel: bpel_ends = true Transformed into TestCase: Input: Customer requests for an amount of 3 (less than four) Input: Assessor sets risk to low Output: reply to Customer is affirmative Pointner StefanAK Softwaretechnologie 1 WS 2013/1418
19
Using SPIN to generate test case specifications Pointner StefanAK Softwaretechnologie 1 WS 2013/1419 Full transition coverage with three executions: {1, 3, 5} {1, 4, 6} {2, 6}
20
Conclusion Generate test case specification from BPEL composition of web services Method relies on SPIN Model Checker Repeat execute to get a test suite for transition coverage Independence from the particular implementation, only BPEL specification as input needed Pointner StefanAK Softwaretechnologie 1 WS 2013/1420
21
Any Questions? José García-Fanjul, Javier Tuya, and Claudio de la Riva. Generating test cases specifications for BPEL compositions of web services using SPIN. In Antonia Bertolino and Andrea Polini, editors, in Proceedings of International Workshop on Web Services Modeling and Testing (WS-MaTe2006), pages 83-94, Palermo, Sicily, ITALY, June 9th 2006. Pointner StefanAK Softwaretechnologie 1 WS 2013/1421
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.