Generating Interface Grammars from WSDL for Automated Verification of Web Services (Talk @ ICSOC 2009)

576 views

Published on

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.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
576
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Generating Interface Grammars from WSDL for Automated Verification of Web Services (Talk @ ICSOC 2009)

  1. 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
  2. 2. A motivating scenario Hallé, Hughes, Bultan, Alkhalaf
  3. 3. A motivating scenario Hallé, Hughes, Bultan, Alkhalaf
  4. 4. A motivating scenario $ Hallé, Hughes, Bultan, Alkhalaf
  5. 5. A motivating scenario ? Hallé, Hughes, Bultan, Alkhalaf
  6. 6. A motivating scenario ? express checkout Hallé, Hughes, Bultan, Alkhalaf
  7. 7. A motivating scenario ! express checkout Hallé, Hughes, Bultan, Alkhalaf
  8. 8. A motivating scenario ? ! express checkout Hallé, Hughes, Bultan, Alkhalaf
  9. 9. A motivating scenario express checkout Hallé, Hughes, Bultan, Alkhalaf
  10. 10. A motivating scenario express checkout Hallé, Hughes, Bultan, Alkhalaf
  11. 11. A motivating scenario express checkout Hallé, Hughes, Bultan, Alkhalaf
  12. 12. More concretely Hallé, Hughes, Bultan, Alkhalaf
  13. 13. More concretely PP Hallé, Hughes, Bultan, Alkhalaf
  14. 14. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </PaymentDetails> </SetExpressCheckoutRequest> Hallé, Hughes, Bultan, Alkhalaf
  15. 15. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </PaymentDetails> </SetExpressCheckoutRequest> <SetExpressCheckoutResponse> <Token>1234</Token> </SetExpressCheckoutResponse> Hallé, Hughes, Bultan, Alkhalaf
  16. 16. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </PaymentDetails> </SetExpressCheckoutRequest> <SetExpressCheckoutResponse> <Token>1234</Token> </SetExpressCheckoutResponse> <GetExpressCheckoutDetails> <Token>1234</Token> <PayerID>abcd</PayerId> </GetExpressCheckoutDetails> Hallé, Hughes, Bultan, Alkhalaf
  17. 17. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </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> Hallé, Hughes, Bultan, Alkhalaf
  18. 18. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </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> Hallé, Hughes, Bultan, Alkhalaf
  19. 19. More concretely PP <SetExpressCheckoutRequest> <PaymentDetails> <Token>1234</Token> <OrderTotal>50</OrderTotal> <PaymentDetailsItem> <Number>456</Number> <Quantity>1</Quantity> </PaymentDetailsItem> <PaymentAction>Sale</PaymentAction> </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
  20. 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. 21. More concretely PP Many ways to make the exchange fail Hallé, Hughes, Bultan, Alkhalaf
  22. 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. 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. 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. 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. 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. 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. 28. More concretely PP Many ways to make the exchange fail Hallé, Hughes, Bultan, Alkhalaf
  29. 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. 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. 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. 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. 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. 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. 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. 36. More concretely PP Many ways to make the exchange fail Hallé, Hughes, Bultan, Alkhalaf
  37. 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. 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. 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. 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. 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. 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. 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
  44. 44. More concretely ??? Hallé, Hughes, Bultan, Alkhalaf
  45. 45. More concretely ??? Hallé, Hughes, Bultan, Alkhalaf
  46. 46. Proposed solution We want to do, as automatically as possible... Hallé, Hughes, Bultan, Alkhalaf
  47. 47. Proposed solution We want to do, as automatically as possible... Œ Hallé, Hughes, Bultan, Alkhalaf
  48. 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. 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. 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. 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. 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. 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. 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
  55. 55. Related work Hallé, Hughes, Bultan, Alkhalaf
  56. 56. Related work Stub/ driver Hallé, Hughes, Bultan, Alkhalaf
  57. 57. Related work Stub/ driver Constraints Structure Values Sequence Hallé, Hughes, Bultan, Alkhalaf
  58. 58. Related work Stub/ driver Constraints Structure Values Sequence Hallé, Hughes, Bultan, Alkhalaf
  59. 59. Related work Stub/ driver Constraints Structure Values Sequence soapUI with "mock web services" Hallé, Hughes, Bultan, Alkhalaf
  60. 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. 61. Related work Stub/ driver Constraints Structure Values Sequence Cacciagrano et al., WS-FM 2006 (validation only) Hallé, Hughes, Bultan, Alkhalaf
  62. 62. Related work Stub/ driver Constraints Structure Values Sequence Bai et al., SOSE 2005 Bartolini et al., ICSOC 2008 Hallé, Hughes, Bultan, Alkhalaf
  63. 63. Related work Stub/ driver Constraints Structure Values Sequence Hallé & Villemaire, CAV 2009 (validation only) Hallé, Hughes, Bultan, Alkhalaf
  64. 64. Related work Stub/ driver Constraints Structure Values Sequence Hughes & Bultan, ISSTA 2007 Hallé, Hughes, Bultan, Alkhalaf
  65. 65. Related work Stub/ driver Constraints Structure Values Sequence Hughes & Bultan, AFM 2007 Hallé, Hughes, Bultan, Alkhalaf
  66. 66. Related work Stub/ driver Constraints Structure Values Sequence Hughes & Bultan, TAV-WEB 2008 Hallé, Hughes, Bultan, Alkhalaf
  67. 67. Related work Stub/ driver Constraints Structure Values Sequence The present paper Hallé, Hughes, Bultan, Alkhalaf
  68. 68. Tool architecture Hallé, Hughes, Bultan, Alkhalaf
  69. 69. Tool architecture Control-flow constraints Hallé, Hughes, Bultan, Alkhalaf
  70. 70. Tool architecture Interface grammar Control-flow G constraints Hallé, Hughes, Bultan, Alkhalaf
  71. 71. Tool architecture Interface grammar Control-flow G constraints WSDL Hallé, Hughes, Bultan, Alkhalaf
  72. 72. Tool architecture Interface grammar Translator Control-flow G constraints WSDL Hallé, Hughes, Bultan, Alkhalaf
  73. 73. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Hallé, Hughes, Bultan, Alkhalaf
  74. 74. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler Hallé, Hughes, Bultan, Alkhalaf
  75. 75. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler Service driver Hallé, Hughes, Bultan, Alkhalaf
  76. 76. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler Service driver Hallé, Hughes, Bultan, Alkhalaf
  77. 77. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  78. 78. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  79. 79. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler automated Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  80. 80. Tool architecture Interface grammar Control-flow Translator G constraints WSDL Interface compiler automated Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  81. 81. Interface grammar Recall: grammar Hallé, Hughes, Bultan, Alkhalaf
  82. 82. Interface grammar Recall: grammar S ® AB|e A ® login S | S login B ® logout S | S logout Hallé, Hughes, Bultan, Alkhalaf
  83. 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. 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. 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. 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. 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. 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. 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. 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
  91. 91. Interface grammar DRIVER Hallé, Hughes, Bultan, Alkhalaf
  92. 92. Interface grammar G DRIVER Hallé, Hughes, Bultan, Alkhalaf
  93. 93. Interface grammar G ? DRIVER Hallé, Hughes, Bultan, Alkhalaf
  94. 94. Interface grammar G 1 DRIVER Hallé, Hughes, Bultan, Alkhalaf
  95. 95. Interface grammar G 1 DRIVER Hallé, Hughes, Bultan, Alkhalaf
  96. 96. Interface grammar G 2 DRIVER Hallé, Hughes, Bultan, Alkhalaf
  97. 97. Interface grammar G 2 ÎG ? 2 DRIVER Hallé, Hughes, Bultan, Alkhalaf
  98. 98. Interface grammar G üû / 2 DRIVER Hallé, Hughes, Bultan, Alkhalaf
  99. 99. Interface grammar G STUB Hallé, Hughes, Bultan, Alkhalaf
  100. 100. Interface grammar G 1 STUB Hallé, Hughes, Bultan, Alkhalaf
  101. 101. Interface grammar G 1 ÎG ? 1 STUB Hallé, Hughes, Bultan, Alkhalaf
  102. 102. Interface grammar G üû / 1 STUB Hallé, Hughes, Bultan, Alkhalaf
  103. 103. Interface grammar G ? 1 STUB Hallé, Hughes, Bultan, Alkhalaf
  104. 104. Interface grammar G 2 1 STUB Hallé, Hughes, Bultan, Alkhalaf
  105. 105. Interface grammar G 2 2 STUB Hallé, Hughes, Bultan, Alkhalaf
  106. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 118. Interface grammar Interface grammar Control-flow G constraints Interface compiler Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  119. 119. Interface grammar Interface grammar Control-flow G constraints Interface compiler Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  120. 120. Interface grammar Interface grammar Control-flow G constraints still missing message structure Interface compiler Service Server driver stub Hallé, Hughes, Bultan, Alkhalaf
  121. 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. 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. 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. 124. From WSDL to interface grammar rules WSDL provides a (machine-readable) definition of a message's structure Hallé, Hughes, Bultan, Alkhalaf
  125. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 135. Experimental results We extracted interface grammars for two real-world web services: Express Checkout E-Commerce Service Hallé, Hughes, Bultan, Alkhalaf
  136. 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. 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. 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. 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

×