generating interface grammars from wsdl for automated verification of web services (talk @ icsoc...
DESCRIPTION
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.TRANSCRIPT
Hallé, Hughes, Bultan, Alkhalaf
Sylvain Hallé, Graham Hughes,Tevfik Bultan, Muath Alkhalaf
Generating Interface Grammarsfrom WSDL for AutomatedVerification of Web Services
University of CaliforniaSanta Barbara, USA
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
$
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
?
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
?
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
!
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
!
?
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
Hallé, Hughes, Bultan, Alkhalaf
A motivating scenario
express checkoutexpress checkout
Hallé, Hughes, Bultan, Alkhalaf
More concretely
Hallé, Hughes, Bultan, Alkhalaf
More concretely
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
<GetExpressCheckoutDetails>
</GetExpressCheckoutDetails>
1234 abcd<Token> </Token><PayerID> </PayerId>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
<GetExpressCheckoutDetails>
</GetExpressCheckoutDetails>
1234 abcd<Token> </Token><PayerID> </PayerId>
<GetExpressCheckoutDetailsResponse>
</GetExpressCheckoutDetailsResponse>
1234 abcd ...
<Token> </Token><PayerID> </PayerId><PaymentDetails> </PaymentDetails>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
<GetExpressCheckoutDetails>
</GetExpressCheckoutDetails>
1234 abcd<Token> </Token><PayerID> </PayerId>
<GetExpressCheckoutDetailsResponse>
</GetExpressCheckoutDetailsResponse>
1234 abcd ...
<Token> </Token><PayerID> </PayerId><PaymentDetails> </PaymentDetails>
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
<GetExpressCheckoutDetails>
</GetExpressCheckoutDetails>
1234 abcd<Token> </Token><PayerID> </PayerId>
<GetExpressCheckoutDetailsResponse>
</GetExpressCheckoutDetailsResponse>
1234 abcd ...
<Token> </Token><PayerID> </PayerId><PaymentDetails> </PaymentDetails>
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
<DoExpressCheckoutPaymentResponse>
</DoExpressCheckoutPaymentResponse>
1234 7890
<Token> </Token><PaymentInfo>
</PaymentInfo><TransactionID> </TransactionId>
PPPP
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 1234<Token> </Token>
<GetExpressCheckoutDetails>
</GetExpressCheckoutDetails>
1234 abcd<Token> </Token><PayerID> </PayerId>
<GetExpressCheckoutDetailsResponse>
</GetExpressCheckoutDetailsResponse>
1234 abcd ...
<Token> </Token><PayerID> </PayerId><PaymentDetails> </PaymentDetails>
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
<DoExpressCheckoutPaymentResponse>
</DoExpressCheckoutPaymentResponse>
1234 7890
<Token> </Token><PaymentInfo>
</PaymentInfo><TransactionID> </TransactionId>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPP
unexpectedelement
Many ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPP
PaymentActionmissing
Many ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Name> </Name>
</SetExpressCheckoutRequest>
<PaymentDetails>
<FooBar> </FooBar> </PaymentDetails>
1234 50 John Doe ...
bazbaz
<Token> </Token><OrderTotal> </OrderTotal><CustomerAddress>
</CustomerAddress>
PPPPMany ways to make the exchange
1. Messagewith wrong
fail
structure
PaymentActionmissing
Hallé, Hughes, Bultan, Alkhalaf
More concretely
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPP
should beequal
Many ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPP
should beequal
Many ways to make the exchange
2. Messagewith goodstructure
fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<SetExpressCheckoutRequest>
<Number> </Number><Quantity> </Quantity>
</SetExpressCheckoutRequest>
<PaymentDetails>
</PaymentDetailsItem> <PaymentAction> </PaymentAction> </PaymentDetails>
<Token> </Token> <OrderTotal> </OrderTotal> <PaymentDetailsItem> 5
123450
4 61
Sale
<SetExpressCheckoutResponse>
</SetExpressCheckoutResponse> 5678<Token> </Token>
PPPP
should beequal
Many ways to make the exchange
2. Messagewith goodstructure but
values
fail
wrong
Hallé, Hughes, Bultan, Alkhalaf
More concretely
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPPMany ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPP
the first occurrenceof a token must be ina SetExpressCheckoutrequest
Many ways to make the exchange fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPP
the first occurrenceof a token must be ina SetExpressCheckoutrequest
Many ways to make the exchange
3. Messagewith goodstructure andgood values
fail
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPP
the first occurrenceof a token must be ina SetExpressCheckoutrequest
Many ways to make the exchange
3. Messagewith goodstructure andgood valuesin the wrong
fail
sequence
Hallé, Hughes, Bultan, Alkhalaf
More concretely
<DoExpressCheckoutPaymentRequest>
</DoExpressCheckoutPaymentRequest>
1234 abcd Sale
<Token> </Token><PayerID> </PayerId><PaymentAction> </PaymentAction>
PPPP
the first occurrenceof a token must be ina SetExpressCheckoutrequest
Many ways to make the exchange
3. Messagewith goodstructure andgood valuesin the wrong
fail
sequence
???
Hallé, Hughes, Bultan, Alkhalaf
More concretely
???
Hallé, Hughes, Bultan, Alkhalaf
More concretely
???
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
�
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
�
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
DRIVER
�
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
! Check if service does what we expect/understand
DRIVER
�
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
! Check if service does what we expect/understand
DRIVER
� �
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
! Check if service does what we expect/understand
...impersonate the service, generate responses to the client
DRIVER
� �
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
! Check if service does what we expect/understand
...impersonate the service, generate responses to the client
DRIVER STUB
� �
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
We want to do, ...as automatically as possible
...impersonate the client, send test sequences to the service
! Check if service does what we expect/understand
...impersonate the service, generate responses to the client
! Environment closedmodel checking possibleÞ
DRIVER STUB
� �
Proposed solution
Hallé, Hughes, Bultan, Alkhalaf
Related work
Hallé, Hughes, Bultan, Alkhalaf
Related work
Stub/driver
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
soapUI with "mock web services"
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Java API for XML Web Services; IBM Web Service Validation Tool (validation only)
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Cacciagrano et al., WS-FM 2006(validation only)
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Bai et al., SOSE 2005Bartolini et al., ICSOC 2008
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hallé & Villemaire, CAV 2009(validation only)
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hughes & Bultan, ISSTA 2007
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hughes & Bultan, AFM 2007
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
Hughes & Bultan, TAV-WEB 2008
Hallé, Hughes, Bultan, Alkhalaf
Related work
Structure
Stub/driver
Constraints
Values
Sequence
The present paper
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
Control-flowconstraints
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
Interfacegrammar
Control-flowconstraintsG
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraintsG
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraintsTranslator G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraintsTranslator G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraintsTranslator
Interfacecompiler
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Translator
Interfacecompiler
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Translator
Interfacecompiler
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Translator
Interfacecompiler
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Translator
Interfacecompiler
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Translator
Interfacecompiler
automated
G
Hallé, Hughes, Bultan, Alkhalaf
Tool architecture
WSDL
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Translator
Interfacecompiler
automated
G
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
A login S | S login®B logout S | S logout®
S A B | e®
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
production rule
A login S | S login®B logout S | S logout®
S A B | e®
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
production rule
start symbol
A login S | S login®B logout S | S logout®
S A B | e®
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
production rule
start symbolnonterminal
A login S | S login®B logout S | S logout®
S A B | e®
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
production rule
start symbolnonterminal
terminal
A login S | S login®B logout S | S logout®
S A B | e®
Hallé, Hughes, Bultan, Alkhalaf
Recall: grammar
Interface grammar
production rule
start symbolnonterminal
terminal
empty symbol
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Recall:
Sufficient to express : "every login can be matched
to exactly one logout in the future"
grammar
control-flowconstraints
Interface grammar
production rule
start symbolnonterminal
terminal
empty symbol
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Two uses for the grammar:
1. that a given sequence belongs to that grammarCheck
Interface grammar
What about login login logout logout ?
SA B
login S Blogin A B B
...login login logout logout
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Two uses for the grammar:
2. sequences belonging to that grammarGenerate
Interface grammar
S A B | e®A login S | S login®B logout S | S logout®
SA B
login S Blogin B
...login logout
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
DRIVER
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
?
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
1
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
1
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
2
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
2
?2 ÎG
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
DRIVER
2
üû/
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
1
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
1
?1 ÎG
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
1
üû/
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
?
1
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
1
2
Hallé, Hughes, Bultan, Alkhalaf
Interface grammar
G
STUB
2
2
Hallé, Hughes, Bultan, Alkhalaf
Interesting consequence:
We use the same grammar for:
! Checking messages! Generating messages
Both to produce:
! A stub! A driver
G
Interface grammar
G
Hallé, Hughes, Bultan, Alkhalaf
Sufficient to express : "every login can be matched
to exactly one logout in the future"
control-flowconstraints
Interface grammar
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Sufficient to express : "every login can be matched
to exactly one logout in the future"
control-flowconstraints
Interface grammar
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
S A B | e®A login S | S login®B logout S | S logout®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
argument
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
argument
the same x
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
argument
the same x
®
checks that x is an intgenerates an int x
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
argumentsemantic predicate
semantic action
the same x
®
checks that x is an intgenerates an int x
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Extensions to classical grammar
Sufficient to express control-flow : "every login with argument x
can be matched to exactly one logout withargument x in the future"
and valueconstraints
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
argumentsemantic predicate
semantic action
the same x
®
checks that x is an intgenerates an int x
int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Example: generate a sequence
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | e
Sint(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)
S
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Example: generate a sequence
Sint(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)
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Interfacecompiler
Interface grammar
G
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Interfacecompiler
Interface grammar
G
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraints
Servicedriver
Serverstub
Interfacecompiler
Interface grammar
still missingmessage structure
G
Hallé, Hughes, Bultan, Alkhalaf
We have production rules to check/generate data types...
primitive
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
Hallé, Hughes, Bultan, Alkhalaf
We have production rules to check/generate data types...
How can we get similar rules for data types?
primitive
composite
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
!login(x) áá???ññ®
Hallé, Hughes, Bultan, Alkhalaf
We have production rules to check/generate data types...
How can we get similar rules for data types?
primitive
composite
Interface grammar
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
!login(x) áá???ññ®WSDL
Hallé, Hughes, Bultan, Alkhalaf
From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's structure
Hallé, Hughes, Bultan, Alkhalaf
From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's structure
Short-hand notation: (MSL; Brown et al., WWW 2001)
Model Schema Language
SetExpressCheckoutRequest[ Token[ ] , PaymentDetails[ OrderTotal[ ], PaymentDetailsItem[ Number[ ], Quantity[ ] ] ]]
string
int
intint
{0,1}
{1,8}{0,8}
Hallé, Hughes, Bultan, Alkhalaf
From WSDL to interface grammar rules
WSDL provides a (machine-readable) definition of a message's structure
Short-hand notation: (MSL; Brown et al., WWW 2001)
Model Schema Language
<SetExpressCheckoutRequest>
</SetExpressCheckoutRequest>
<PaymentDetails
</PaymentDetailsItem><PaymentAction> </PaymentAction>
</PaymentDetails>
> 1234 50 456 1 Sale
<Token> </Token><OrderTotal> </OrderTotal><PaymentDetailsItem><Number> </Number><Quantity> </Quantity>
SetExpressCheckoutRequest[ Token[ ] , PaymentDetails[ OrderTotal[ ], PaymentDetailsItem[ Number[ ], Quantity[ ] ] ]]
string
int
intint
{0,1}
{1,8}{0,8}
Hallé, Hughes, Bultan, Alkhalaf
We build a (recursive) mapping p from MSL constructs to sets of production rules
Example:
Mapping for other MSL constructs: see the paper (straightforward)
From WSDL to interface grammar rules
p[[Element[e] ]] ={0,1}
® ááx=nullññ |ááx=new Element();ññ
Element(x)È p[[e(x)]]{ }
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraintsG
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraintsG
WSDL
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraintsG
WSDL(MSL)
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraintsG
WSDL(MSL)
Translator
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraints
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
WSDL(MSL)
Translator G
® ááx=new Login();ññ logininside(x,y)!login(x)
® ááy=new UserId(); x.userId=y;ññ...
logininside(x,y)
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
Interfacegrammar
Control-flowconstraints
®A(x) !login(x) S | S !login(x)®B(x) !logout(x) S | S !logout(x)®
® int(x) A(x) B(x) | eS
int(x) ááx=0ññ | ááx=1ññ | ...®
WSDL(MSL)
Translator G
® ááx=new Login();ññ logininside(x,y)!login(x)
® ááy=new UserId(); x.userId=y;ññ...
logininside(x,y)
From WSDL to interface grammar rules
Hallé, Hughes, Bultan, Alkhalaf
® ááx=new Login();ññ logininside(x,y)!login(x)
From WSDL to interface grammar rules
Java code, classesprovided by Apache Axis
Hallé, Hughes, Bultan, Alkhalaf
We extracted interface grammars for two real-world web services:
Experimental results
E-Commerce ServiceExpress Checkout
Hallé, Hughes, Bultan, Alkhalaf
We extracted interface grammars for two real-world web services:
Java/Axis driver generated test sequences to the actual service
Experimental results
E-Commerce ServiceExpress Checkout
�
Hallé, Hughes, Bultan, Alkhalaf
We extracted interface grammars for two real-world web services:
Java/Axis driver generated test sequences to the actual service
Pair Java client/Java stub model checked with Java Pathfinder
Experimental results
E-Commerce ServiceExpress Checkout
�
�
Hallé, Hughes, Bultan, Alkhalaf
! Driver message generation time: 1 sec./message! Typical test sequence: ! Found between implementation and
documentation
! Multiple contract violations found in sample client using Java Pathfinder
! Maximum checking time: / memory! Found between impl. and doc. with driver
5 seconds2 mismatches
20 sec. 43 MB2 mismatches
Experimental results
Hallé, Hughes, Bultan, Alkhalaf
1. Long-running WS interactions involve constraints overmessage , and
2. We developed interface grammars to model these constraintsin a uniform notation
3. Using the same IG, we can generate a service and a client to perform model checking / test
generation
4. We tested the approach with two real-worldWS and found betweendocumentation and implementation
structure values sequence
automaticallystub driver
mismatches
Take-home points