Using interface grammars to model the interface contract of a web service, we can automatically generate stubs and drivers to test and verify a web service client.
Solving Equations on Words with Morphisms and Antimorphisms
Generating Interface Grammars from WSDL for Automated Verification of Web Services (Talk @ ICSOC 2009)
1. Generating Interface Grammars
from WSDL for Automated
Verification of Web Services
Sylvain Hallé, Graham Hughes,
Tevfik Bultan, Muath Alkhalaf
University of California
Santa Barbara, USA
Hallé, Hughes, Bultan, Alkhalaf
20. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>1234</Token>
</SetExpressCheckoutResponse>
<GetExpressCheckoutDetails>
<Token>1234</Token>
<PayerID>abcd</PayerId>
</GetExpressCheckoutDetails>
<GetExpressCheckoutDetailsResponse>
<Token>1234</Token>
<PayerID>abcd</PayerId>
<PaymentDetails>...</PaymentDetails>
</GetExpressCheckoutDetailsResponse>
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest>
<DoExpressCheckoutPaymentResponse>
<Token>1234</Token>
<PaymentInfo>
<TransactionID>7890</TransactionId>
</PaymentInfo>
</DoExpressCheckoutPaymentResponse>
Hallé, Hughes, Bultan, Alkhalaf
21. More concretely
PP
Many ways to
make the
exchange fail
Hallé, Hughes, Bultan, Alkhalaf
22. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
Hallé, Hughes, Bultan, Alkhalaf
23. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
Hallé, Hughes, Bultan, Alkhalaf
24. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
Hallé, Hughes, Bultan, Alkhalaf
25. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
unexpected
element
Hallé, Hughes, Bultan, Alkhalaf
26. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
PaymentAction
missing
Hallé, Hughes, Bultan, Alkhalaf
27. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<CustomerAddress>
<Name>John Doe</Name>
make the
...
</CustomerAddress>
<FooBar>bazbaz</FooBar>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
PaymentAction
missing
1. Message
with wrong
structure
Hallé, Hughes, Bultan, Alkhalaf
28. More concretely
PP
Many ways to
make the
exchange fail
Hallé, Hughes, Bultan, Alkhalaf
29. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
Hallé, Hughes, Bultan, Alkhalaf
30. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
Hallé, Hughes, Bultan, Alkhalaf
31. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
Hallé, Hughes, Bultan, Alkhalaf
32. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
Hallé, Hughes, Bultan, Alkhalaf
33. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
should be
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
equal make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
Hallé, Hughes, Bultan, Alkhalaf
34. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
should be
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
equal make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
2. Message
with good
structure
Hallé, Hughes, Bultan, Alkhalaf
35. More concretely
PP
<SetExpressCheckoutRequest>
<PaymentDetails>
Many ways to
<Token>1234</Token>
should be
<OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
<Number>456</Number>
equal make the
<Quantity>1</Quantity>
</PaymentDetailsItem>
<PaymentAction>Sale</PaymentAction>
exchange fail
</PaymentDetails>
</SetExpressCheckoutRequest>
<SetExpressCheckoutResponse>
<Token>5678</Token>
</SetExpressCheckoutResponse>
2. Message
with good
structure but
wrong values
Hallé, Hughes, Bultan, Alkhalaf
36. More concretely
PP
Many ways to
make the
exchange fail
Hallé, Hughes, Bultan, Alkhalaf
37. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
Hallé, Hughes, Bultan, Alkhalaf
38. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
Hallé, Hughes, Bultan, Alkhalaf
39. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
Hallé, Hughes, Bultan, Alkhalaf
40. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
the first occurrence
of a token must be in
a SetExpressCheckout
request
Hallé, Hughes, Bultan, Alkhalaf
41. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
the first occurrence 3. Message
of a token must be in
a SetExpressCheckout with good
request
structure and
good values
Hallé, Hughes, Bultan, Alkhalaf
42. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
the first occurrence 3. Message
of a token must be in
a SetExpressCheckout with good
request
structure and
good values
in the wrong
sequence
Hallé, Hughes, Bultan, Alkhalaf
43. More concretely
PP
Many ways to
<DoExpressCheckoutPaymentRequest>
<Token>1234</Token>
<PayerID>abcd</PayerId>
make the
<PaymentAction>Sale</PaymentAction>
</DoExpressCheckoutPaymentRequest> exchange fail
the first occurrence 3. Message
of a token must be in
a SetExpressCheckout with good
request
???
structure and
good values
in the wrong
sequence
Hallé, Hughes, Bultan, Alkhalaf
46. Proposed solution
We want to do, as automatically as possible...
Hallé, Hughes, Bultan, Alkhalaf
47. Proposed solution
We want to do, as automatically as possible...
Œ
Hallé, Hughes, Bultan, Alkhalaf
48. Proposed solution
We want to do, as automatically as possible...
Œ
...impersonate the client, send
test sequences to the service
Hallé, Hughes, Bultan, Alkhalaf
49. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER
...impersonate the client, send
test sequences to the service
Hallé, Hughes, Bultan, Alkhalaf
50. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER
...impersonate the client, send
test sequences to the service
! Check if service does what
we expect/understand
Hallé, Hughes, Bultan, Alkhalaf
51. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER
...impersonate the client, send
test sequences to the service
! Check if service does what
we expect/understand
Hallé, Hughes, Bultan, Alkhalaf
52. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER
...impersonate the client, send ...impersonate the service,
test sequences to the service generate responses to the client
! Check if service does what
we expect/understand
Hallé, Hughes, Bultan, Alkhalaf
53. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER STUB
...impersonate the client, send ...impersonate the service,
test sequences to the service generate responses to the client
! Check if service does what
we expect/understand
Hallé, Hughes, Bultan, Alkhalaf
54. Proposed solution
We want to do, as automatically as possible...
Œ
DRIVER STUB
...impersonate the client, send ...impersonate the service,
test sequences to the service generate responses to the client
! Check if service does what ! Environment closed
we expect/understand Þ model checking possible
Hallé, Hughes, Bultan, Alkhalaf
56. Related work
Stub/
driver
Hallé, Hughes, Bultan, Alkhalaf
57. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hallé, Hughes, Bultan, Alkhalaf
58. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hallé, Hughes, Bultan, Alkhalaf
59. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
soapUI with "mock web services"
Hallé, Hughes, Bultan, Alkhalaf
60. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Java API for XML Web Services; IBM Web Service Validation
Tool (validation only)
Hallé, Hughes, Bultan, Alkhalaf
61. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Cacciagrano et al., WS-FM 2006
(validation only)
Hallé, Hughes, Bultan, Alkhalaf
62. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Bai et al., SOSE 2005
Bartolini et al., ICSOC 2008
Hallé, Hughes, Bultan, Alkhalaf
63. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hallé & Villemaire, CAV 2009
(validation only)
Hallé, Hughes, Bultan, Alkhalaf
64. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hughes & Bultan, ISSTA 2007
Hallé, Hughes, Bultan, Alkhalaf
65. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hughes & Bultan, AFM 2007
Hallé, Hughes, Bultan, Alkhalaf
66. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
Hughes & Bultan, TAV-WEB 2008
Hallé, Hughes, Bultan, Alkhalaf
67. Related work
Stub/
driver
Constraints
Structure
Values
Sequence
The present paper
Hallé, Hughes, Bultan, Alkhalaf
82. Interface grammar
Recall: grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
Hallé, Hughes, Bultan, Alkhalaf
83. Interface grammar
Recall: grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule
Hallé, Hughes, Bultan, Alkhalaf
84. Interface grammar
Recall: grammar
start symbol
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule
Hallé, Hughes, Bultan, Alkhalaf
85. Interface grammar
Recall: grammar
nonterminal
start symbol
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule
Hallé, Hughes, Bultan, Alkhalaf
86. Interface grammar
Recall: grammar
nonterminal
start symbol
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule terminal
Hallé, Hughes, Bultan, Alkhalaf
87. Interface grammar
Recall: grammar
nonterminal
start symbol
empty symbol
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule terminal
Hallé, Hughes, Bultan, Alkhalaf
88. Interface grammar
Recall: grammar
nonterminal
start symbol
empty symbol
S ® AB|e
A ® login S | S login
B ® logout S | S logout
production rule terminal
Sufficient to express control-flow
constraints: "every login can be matched
to exactly one logout in the future"
Hallé, Hughes, Bultan, Alkhalaf
89. Interface grammar
Two uses for the grammar:
1. Check that a given sequence belongs to that grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
What about login login logout logout ?
S
AB
login S B
login A B B
...
login login logout logout
Hallé, Hughes, Bultan, Alkhalaf
90. Interface grammar
Two uses for the grammar:
2. Generate sequences belonging to that grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
S
AB
login S B
login B
...
login logout
Hallé, Hughes, Bultan, Alkhalaf
106. Interface grammar
Interesting consequence:
G
We use the same grammar G for:
! Checking messages
! Generating messages
Both to produce:
! A stub
! A driver
Hallé, Hughes, Bultan, Alkhalaf
107. Interface grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
Sufficient to express control-flow
constraints: "every login can be matched
to exactly one logout in the future"
Hallé, Hughes, Bultan, Alkhalaf
108. Interface grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
Sufficient to express control-flow
constraints: "every login can be matched
to exactly one logout in the future"
Hallé, Hughes, Bultan, Alkhalaf
109. Interface grammar
Extensions to classical grammar
S ® AB|e
A ® login S | S login
B ® logout S | S logout
Hallé, Hughes, Bultan, Alkhalaf
110. Interface grammar
Extensions to classical grammar
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
Hallé, Hughes, Bultan, Alkhalaf
111. Interface grammar
Extensions to classical grammar
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
argument
Hallé, Hughes, Bultan, Alkhalaf
112. Interface grammar
Extensions to classical grammar
the same x
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
argument
Hallé, Hughes, Bultan, Alkhalaf
113. Interface grammar
Extensions to classical grammar
checks that x is an int the same x
generates an int x
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
argument
Hallé, Hughes, Bultan, Alkhalaf
114. Interface grammar
Extensions to classical grammar
checks that x is an int the same x
generates an int x
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
argument
semantic predicate
semantic action
Hallé, Hughes, Bultan, Alkhalaf
115. Interface grammar
Extensions to classical grammar
checks that x is an int the same x
generates an int x
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
argument
semantic predicate
semantic action
Sufficient to express control-flow and value
constraints: "every login with argument x
can be matched to exactly one logout with
argument x in the future"
Hallé, Hughes, Bultan, Alkhalaf
116. Interface grammar
Example: generate a sequence
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
S
int(x) A(x) B(x)
A(1) B(1)
!login(1) S B(1)
!login(1) S !logout(1)
!login(1) int(x) A(x) B(x) !logout(1)
Hallé, Hughes, Bultan, Alkhalaf
117. Interface grammar
Example: generate a sequence
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
S
int(x) A(x) B(x)
A(1) B(1)
!login(1) S B(1)
!login(1) S !logout(1)
!login(1) int(x) A(x) B(x) !logout(1)
Hallé, Hughes, Bultan, Alkhalaf
118. Interface grammar
Interface
grammar
Control-flow
G constraints
Interface
compiler
Service Server
driver stub
Hallé, Hughes, Bultan, Alkhalaf
119. Interface grammar
Interface
grammar
Control-flow
G constraints
Interface
compiler
Service Server
driver stub
Hallé, Hughes, Bultan, Alkhalaf
120. Interface grammar
Interface
grammar
Control-flow
G constraints
still missing
message structure
Interface
compiler
Service Server
driver stub
Hallé, Hughes, Bultan, Alkhalaf
121. Interface grammar
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
We have production rules to check/generate primitive data
types...
Hallé, Hughes, Bultan, Alkhalaf
122. Interface grammar
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
!login(x) ® áá???ññ
We have production rules to check/generate primitive data
types...
How can we get similar rules for composite data types?
Hallé, Hughes, Bultan, Alkhalaf
123. Interface grammar
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
!login(x) ® WSDL
áá???ññ
We have production rules to check/generate primitive data
types...
How can we get similar rules for composite data types?
Hallé, Hughes, Bultan, Alkhalaf
124. From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's
structure
Hallé, Hughes, Bultan, Alkhalaf
125. From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's
structure
Short-hand notation: Model Schema Language (MSL; Brown
et al., WWW 2001)
SetExpressCheckoutRequest[
Token[string]{0,1},
PaymentDetails[
OrderTotal[int],
PaymentDetailsItem[
Number[int],
Quantity[int]
]{1,8}
]{0,8}
]
Hallé, Hughes, Bultan, Alkhalaf
126. From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's
structure
Short-hand notation: Model Schema Language (MSL; Brown
et al., WWW 2001)
SetExpressCheckoutRequest[
Token[string]{0,1}, <SetExpressCheckoutRequest>
<PaymentDetails>
PaymentDetails[ <Token>1234</Token>
OrderTotal[int], <OrderTotal>50</OrderTotal>
<PaymentDetailsItem>
PaymentDetailsItem[ <Number>456</Number>
<Quantity>1</Quantity>
Number[int], </PaymentDetailsItem>
Quantity[int] <PaymentAction>Sale</PaymentAction>
</PaymentDetails>
]{1,8} </SetExpressCheckoutRequest>
]{0,8}
]
Hallé, Hughes, Bultan, Alkhalaf
127. From WSDL to interface grammar rules
We build a (recursive) mapping p from MSL constructs to sets
of production rules
Example:
p[[Element[e]{0,1}]] =
Element(x) ® ááx=nullññ |
{ ááx=new Element();ññ } È p[[e(x)]]
Mapping for other MSL constructs: see the paper
(straightforward)
Hallé, Hughes, Bultan, Alkhalaf
128. From WSDL to interface grammar rules
Interface
grammar
Control-flow
G constraints
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
Hallé, Hughes, Bultan, Alkhalaf
129. From WSDL to interface grammar rules
Interface
grammar
Control-flow
G constraints
WSDL
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
Hallé, Hughes, Bultan, Alkhalaf
130. From WSDL to interface grammar rules
Interface
grammar
Control-flow
G constraints
WSDL
(MSL)
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
Hallé, Hughes, Bultan, Alkhalaf
131. From WSDL to interface grammar rules
Interface
grammar
Translator Control-flow
G constraints
WSDL
(MSL)
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
Hallé, Hughes, Bultan, Alkhalaf
132. From WSDL to interface grammar rules
Interface
grammar
Control-flow
Translator G constraints
WSDL
(MSL)
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
!login(x) ® ááx=new Login();ññ logininside(x,y)
logininside(x,y) ® ááy=new UserId(); x.userId=y;ññ
...
Hallé, Hughes, Bultan, Alkhalaf
133. From WSDL to interface grammar rules
Interface
grammar
Control-flow
Translator G constraints
WSDL
(MSL)
S ® int(x) A(x) B(x) | e
A(x) ® !login(x) S | S !login(x)
B(x) ® !logout(x) S | S !logout(x)
int(x) ® ááx=0ññ | ááx=1ññ | ...
!login(x) ® ááx=new Login();ññ logininside(x,y)
logininside(x,y) ® ááy=new UserId(); x.userId=y;ññ
...
Hallé, Hughes, Bultan, Alkhalaf
134. From WSDL to interface grammar rules
Java code, classes
provided by Apache Axis
!login(x) ® ááx=new Login();ññ logininside(x,y)
Hallé, Hughes, Bultan, Alkhalaf
135. Experimental results
We extracted interface grammars for two real-world web
services:
Express Checkout E-Commerce Service
Hallé, Hughes, Bultan, Alkhalaf
136. Experimental results
We extracted interface grammars for two real-world web
services:
Express Checkout E-Commerce Service
Java/Axis driver generated test
Œ sequences to the actual service
Hallé, Hughes, Bultan, Alkhalaf
137. Experimental results
We extracted interface grammars for two real-world web
services:
Express Checkout E-Commerce Service
Java/Axis driver generated test
Œ sequences to the actual service
Pair Java client/Java stub model
checked with Java Pathfinder
Hallé, Hughes, Bultan, Alkhalaf
138. Experimental results
! Driver message generation time: 1 sec./message
! Typical test sequence: 5 seconds
! Found 2 mismatches between implementation and
documentation
! Multiple contract violations found in sample client using
Java Pathfinder
! Maximum checking time: 20 sec. / 43 MB memory
! Found 2 mismatches between impl. and doc. with driver
Hallé, Hughes, Bultan, Alkhalaf
139. Take-home points
1. Long-running WS interactions involve constraints over
message structure, values and sequence
2. We developed interface grammars to model these constraints
in a uniform notation
3. Using the same IG, we can automatically generate a service
stub and a client driver to perform model checking / test
generation
4. We tested the approach with two real-world
WS and found mismatches between
documentation and implementation
Hallé, Hughes, Bultan, Alkhalaf