Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara

Similar presentations


Presentation on theme: "Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara"— Presentation transcript:

1 Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara bultan@cs.ucsb.edu

2 Web Services Loosely coupled Standardized data transmission via XML Asynchronous messaging Platform independent (.NET, J2EE) Data Type Service Interaction Message BPEL4WS, WSCI Web Service Standards Implementation Platforms Microsoft.Net, Sun J2EE WSDL SOAP XML Schema XML

3 Motivation Challenges in both specification and verification –Distributed nature, no central control How do we model the global behavior? How do we specify the global properties? –Asynchronous messaging introduces undecidability in analysis How do we check the global behavior? How do we enforce the global behavior? –XML data manipulation How do we specify XML messages? How do we verify properties related to data?

4 Outline Web Service Composition Model Capturing Global Behaviors –Conversations Top-Down Specification and Verification –Realizability Bottom-Up Specification and Verification –Synchronizability Web Service Analysis Tool Conclusions and Future Work Collaborators: Xiang Fu, Jianwen Su, Rick Hull

5 Web Service Composition A composite web service is a tuple S = ( P, M ) [Bultan, Fu, Hull, Su WWW’03]  M : finite set of message classes  P : finite set of peers (web services) TravelerAgency Hotel Airline Req 1 Booking 1 Req 3 Req 2 Booking 3 Booking 2

6 Communication Model Reliable Asynchronous Queues are FIFO and unbounded Airline Agency Req 1 This model is similar to industry efforts –JMS (Java Message Service) –MSMQ (Microsoft Message Queuing Service) R2R2 R2R2

7 Message Classes Messages are classified into classes Each message class is associated with one sender and one receiver Two models for messages: –No content, just classes this model can represent messages with content as long as domains are finite –Messages with content XML messages Airline Agency Req 2

8 Finite State Peers Peer: Finite state automaton + one FIFO queue Extensions –Reactive services: Büchi automata –Message contents: Guarded automata Airline ?Req 3 !Booking 3 [ Booking 3.date := Req 3.date ] input messages output messages

9 Executing Web Service Composition Execution is a complete run if Each sent message is eventually consumed Each peer visits its final states infinitely often Agency ? R 1 ! R 2 ! B 1 ? B 2 ! B 1 ! R 3 ? B 3 R1R1 R2R2 ! R 1 ? B 1 Traveler B1B1 ? R 2 ! B 2 Airline B2B2 ? R 3 ! B 3 Hotel R3R3 B3B3

10 Outline Web Service Composition Model Capturing Global Behaviors –Conversations Top-Down Specification and Verification –Realizability Bottom-Up Specification and Verification –Synchronizability Web Service Analysis Tool Action Language Verifier Conclusions and Future Work

11 Conversations Watcher: “records” the messages as they are sent Watcher Airline Hotel Traveler Agency R1R1 B1B1 R1R1 R2R2 B2B2 B3B3 R3R3 A conversation is a sequence of messages the watcher sees in a complete run Conversation Set: the set of all possible conversations of a service S : C(S) B1B1 R3R3 B3B3 B2B2 R2R2

12 Properties of Conversations The notion of conversation enables us to reason about temporal properties of the web service composition LTL framework extends naturally to conversations –LTL temporal operators X (neXt), U (Until), G (Globally), F (Future) –Atomic properties Predicates on message classes (or contents) Example: G (R 1  F B 1 ) Model checking problem: Given an LTL property, does the conversation set C(S) satisfy the property?

13 Question SGiven a web service composition S, is the language C(S) always regular? If it is regular, finite state model checking techniques can be used for verification

14 Example: C(S) = { w | w  (r | a)  and for each prefix w’, |r| w’  |a| w’ } Answer Conversation Sets are not always regular, even without message contents Causes: asynchronous communication with unbounded queues Bounded queues or synchronous communication  Conversation Set always regular ?a?a!r!r P1P1 P2P2 ?r !a r a

15 Outline Web Service Composition Model Capturing Global Behaviors –Conversations Top-Down Specification and Verification –Realizability Bottom-Up Specification and Verification –Synchronizability Web Service Analysis Tool Action Language Verifier Conclusions and Future Work

16 Bottom-Up vs. Top-Down Bottom-up approach Specify the behavior of each peer The global communication behavior (conversation set) is implicitly defined based on the composed behavior of the peers Global communication behavior is hard to understand and analyze Top-down approach Specify the global communication behavior (conversation set) explicitly as a protocol Ensure that the conversations generated by the peers obey the protocol

17 Conversation Protocol A  B:msg1 B  A:msg2 B  C:msg3C  B:msg4 B  C:msg5 G(msg1  F(msg3  msg5)) ? LTL property !msg1 ?msg2 Peer A ?msg1 !msg2 !msg5 !msg3 ?msg4 Peer B ?msg3 !msg4 Peer C Peer APeer BPeer C msg1 msg2, msg6 msg3, msg5 msg4 Conversation Schema Input Queue... Virtual Watcher ?msg6 B  A:msg6 !msg6 ?msg5 G(msg1  F(msg3  msg5)) ? LTL property (c)

18 Conversation Protocols Conversation Protocol: –An automaton that accepts the desired conversation set –For reactive protocols with infinite message sequences we use: Büchi automata Accept infinite strings –For specifying message contents, we use: Guarded automata Guards are constraints on the message contents A conversation protocol is a contract agreed by all peers –Each peer must act according to the protocol

19 Model Checking Protocols without message contents –Finite state model checking techniques and tools Protocols with finite domain message contents –Finite state model checking techniques and tools Protocols with infinite domain message contents –Infinite state model checking techniques and tools

20 Synthesize Peer Implementations Conversation protocol specifies the global communication behavior –How do we implement the peers? How do we obtain the contracts that peers have to obey from the global contract specified by the conversation protocol? Project the global protocol to each peer –By dropping unrelated messages for each peer

21 Interesting Question Are there conditions which ensure the equivalence? Conversations generated by the composed behavior of the projected services Conversations specified by the conversation protocol  ?

22 Realizability Problem Not all conversation protocols are realizable! A  B: a C  D: b Conversation protocol ! a ? a ! b ? b Peer APeer BPeer CPeer D ba Conversation “ba” will be generated by any legal peer implementation which follows the protocol Projection of the conversation protocol to the peers

23 Realizability Problem Three sufficient conditions for realizability (contentless messages) [Fu, Bultan, Su, CIAA’03] –Lossless join Conversation set should be equivalent to the join of its projections to each peer –Synchronous compatible When the projections are composed synchronously, there should not be a state where a peer is ready to send a message while the corresponding receiver is not ready to receive –Autonomous Each peer should be able to make a deterministic decision on whether to send or to receive or to terminate

24 Realizability for Guarded Protocols One natural conjecture: –Drop all guards and message contents to get the “skeleton” of the conversation protocol –Check realizability of the skeleton Conjecture fails because there exists –Nonrealizable guarded protocols with realizable skeletons, and –Realizable guarded protocols with nonrealizable skeletons.

25 Examples A  B: a(1) C  D: c(1) C  D: c(2) A  B: a(2). c (1) a(2) is a conversation of the projected peers D  B: d(1)D  A: e(2) D  B: d(2)D  A: e(1) A  B: aB  A: b Skeleton is realizable, but guarded protocol is not Guarded protocol is realizable, but its skeleton is not

26 Realizability for Guarded Protocols A fourth condition –Deterministic guards If we determinize projection of the conversation protocol to each peer, all the guards that map to a state should be identical If a guarded conversation protocol satisfies the above property –and if its skeleton satisfies the three conditions we discussed before, then it is realizable

27 Guarded Protocols If the realizability conditions are not met we can still try exhaustive state space exploration –Treat each valuation of message contents as a new message class and get a standard conversation protocol without contents –Accurate, but costly Future work: developing symbolic verification techniques for conversation protocols

28 Outline Web Service Composition Model Capturing Global Behaviors –Conversations Top-Down Specification and Verification –Realizability Bottom-Up Specification and Verification –Synchronizability Web Service Analysis Tool Action Language Verifier Conclusions and Future Work

29 Conversation Protocol A  B:msg1 B  A:msg2 B  C:msg3C  B:msg4 B  C:msg5 G(msg1  F(msg3  msg5)) ? LTL property !msg1 ?msg2 Peer A ?msg1 !msg2 !msg5 !msg3 ?msg4 Peer B ?msg3 !msg4 Peer C Peer APeer BPeer C msg1 msg2, msg6 msg3, msg5 msg4 Conversation Schema Input Queue... Virtual Watcher ?msg6 B  A:msg6 !msg6 ?msg5 G(msg1  F(msg3  msg5)) ? LTL property (c)

30 Bottom-Up Approach We know that analyzing conversations of composite web services is difficult due to asynchronous communication The question is, can we identify composite web services where asynchronous communication does not create a problem?

31 Three Examples, Example 1 ?r 1 !a 1 !a 2 ?r 2 ?e requesterserver !r 2 ?a 1 ?a 2 !e !r 1 Conversation set is regular: (r 1 a 1 | r 2 a 2 )* eConversation set is regular: (r 1 a 1 | r 2 a 2 )* e During all the executions queues are bounded r 1, r 2 a 1, a 2 e

32 Example 2 !r 1 !r 2 ?a 1 ?a 2 !e ?r 1 !a 1 !a 2 ?r 2 ?e r 1, r 2 a 1, a 2 requesterserver e Conversation set is not regularConversation set is not regular Queues are not bounded

33 Example 3 r 1, r 2 a 1, a 2 requesterserver e !r 1 !r !r 2 ?a !e ?r 1 ?r!a ?e ?r 2 Conversation set is regular: (r 1 | r 2 | r a)* eConversation set is regular: (r 1 | r 2 | r a)* e Queues are not bounded

34 Three Examples queue length # of states in thousands Verification of Examples 2 and 3 are difficult even if we bound the queue length How can we distinguish Examples 1 and 3 (with regular conversation sets) from 2? –Synchronizability Analysis

35 Synchronizability Analysis SA composite web service S is synchronizable, if its conversation set C(S) does not change –when asynchronous communication is replaced with synchronous communication A composite web service is synchronizable, if it satisfies the synchronous compatible and autonomous conditions [Fu, Bultan, Su WWW’04]

36 Are These Conditions Too Restrictive? Problem SetSizeSynchronizable? SourceName#msg#states#trans. ISSTA’04SAS91215yes IBM Conv. Support Project CvSetup444yes MetaConv446no Chat245yes Buy556yes Haggle858no AMAB81015yes BPEL spec shipping233yes Loan666yes Auction9910yes Collaxa. com StarLoan677yes Cauction576yes

37 Outline Web Service Composition Model Capturing Global Behaviors –Conversations Top-Down Specification and Verification –Realizability Bottom-Up Specification and Verification –Synchronizability Web Service Analysis Tool Action Language Verifier Conclusions and Future Work

38 BPEL to GFSA Guarded automata GFSA to Promela (bounded queue) BPEL Web Services Promela Synchronizability Analysis GFSA to Promela (synchronous communication) Intermediate Representation Conversation Protocol Front End Realizability Analysis Guarded automaton skip GFSA parser success fail GFSA to Promela (single process, no communication) success fail AnalysisBack End (bottom-up) (top-down) Verification Languages Web Service Analysis Tool

39 Guarded Automata Model Uses XML messages Uses MSL for declaring message types –MSL (Model Schema Language) is a compact formal model language which captures most features of XML Schema Uses XPATH expressions for guards –XPATH is a language for writing expressions (queries) that navigate through XML trees and return a set of answer nodes

40 investorID Register 1234 requestList AAAABBBB payment accountNum 56 stockID An XML Message 1234 AAAA BBBB 56

41 MSL Type Declaration Register[ investorID[xsd:int], requestList[ stockID[xsd:string]{1,50} ], payment[ creditCardNum[xsd:int] | accountNum[xsd:int] ] 1234 AAAA BBBB 56

42 XPATH Queries investorID Register 1234 requestList AAAABBBB payment accountNum 56 stockID //payment/* returns the node labeled accountNum /Register/requestList/stockID/string returns the nodes labeled AAAA and BBBB //stockID[string=AAAA]/string returns the node labeled AAAA

43 The Guarded Automata Model !r 1 ?a 1 ?a 2 !e !r 2 // XML Schema Type Decl. request [ id [int] ] // messages r2: request //local variables last: request Guard{ r2/id = last/id  r2/id := last/id + 1 }

44 Guarded Automata to Promela Restrictions: –Bound all the domains –Only ordered lists Map MSL types to Promela Type System Translate XPATH expressions to Promela

45 $request // stockID = $register // stockID [int()>5] [position() = last()]

46

47 Model Checking Using Promela Subtle errors in an example –SAS: Stock Analysis Service [Fu, Bultan, Su ISSTA’04] –3 peers: Investor, Broker, ResearchDept. –Investor  Broker: a registerList of stockIDs –Broker  ResearchDept.: relay request (1 stockID per request) find the stockID in the latest request, send its subsequent stockID in registerList –Repeating stockID will cause error. –Only discoverable by analysis of XPath expressions

48 Related Work Conversation specification –IBM Conversation support project http://www.research.ibm.com/convsupport/ –Conversation support for business process integration [Hanson, Nandi, Kumaran EDOCC’02] –Orchestrating computations on the world-wide web [Choi, Garg, Rai, Misram, Vin EuroPar’02] Verification of web services –Simulation, verification, composition of web services [Narayanan, McIlraith WWW’02] Realizability problem –Realizability of Message Sequence Charts (MSC) [ Alur, Etassami, Yannakakis ICSE’00, ICALP’01]

49 Current and Future Work More analysis tools are necessary for guarded protocols with infinite domains –Symbolic analysis –Abstraction Extending the source and target languages Tools for model checking web services –Finite state vs. infinite-state –Message contents, local variables

50 Translator for bottom-up specifications Guarded automata Translation with bounded queue Synchronizability Analysis Translation with synchronous communication Intermediate Representation Conversation Protocols Front End Realizability Analysis Guarded automaton skip Translator for top-down specifications success fail Translation with single process, no communication success fail AnalysisBack End BPEL Web Service Specification Languages DAML-S WSCI Promela SMV Action Language Verification Languages... Automated Abstraction Current and Future Work


Download ppt "Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara"

Similar presentations


Ads by Google