Browser-based Enforcement of
         Interface Contracts in Web Applications
                     with BeepBeep

        ...
Some web services



           E-Commerce Service
           Compute Cloud


           PayPal API: billing, express chec...
Using web applications


                             MyApplication.com




Sylvain Hallé
Using web applications


                             MyApplication.com




Sylvain Hallé
Using web applications


                    i   ?    MyApplication.com




Sylvain Hallé
Using web applications


                    i   ?         MyApplication.com




                             1.

        ...
Using web applications

        XML request
         <ListItems>                  MyApplication.com
           <title>bird...
Using web applications
                       2


                             MyApplication.com




Sylvain Hallé
Using web applications
                       2


                             MyApplication.com




                     ...
Using web applications

        XML request
          <cartCreate>         MyApplication.com
            <item>2</item>
  ...
Using web applications
                       2


                       c     MyApplication.com




Sylvain Hallé
Using web applications
                       2


                       c     MyApplication.com




Sylvain Hallé
Constraints on the message trace




Sylvain Hallé
Constraints on the message trace




         i   ?




Sylvain Hallé
Constraints on the message trace




         i   ?
                 1.

                 2.
                      ...



...
Constraints on the message trace




                            2

         i   ?
                 1.

                 2...
Constraints on the message trace




                            2          2

         i   ?
                            ...
Constraints on the message trace


             You cannot add the same item twice
                    to the shopping car...
Constraints on the message trace


             You cannot add the same item twice
                    to the shopping car...
Constraints on the message trace




                                       ???




Sylvain Hallé
Constraints on the message trace




                                       ???




Sylvain Hallé
Constraints on the message trace


           You cannot add the same item twice
                  to the shopping cart
  ...
Constraints on the message trace


           You cannot add the same item twice
                  to the shopping cart


...
Constraints on the message trace


           You cannot add the same item twice
                  to the shopping cart


...
Constraints on the message trace


           You cannot add the same item twice
                  to the shopping cart


...
Enter BeepBeep


                     MyApplication.com




Sylvain Hallé
Enter BeepBeep


                     MyApplication.com




Sylvain Hallé
Enter BeepBeep

        (
      G "i
                i
                    Þ ØF
                           i


           ...
Enter BeepBeep
                 2

                     MyApplication.com




Sylvain Hallé
Enter BeepBeep


                     MyApplication.com




Sylvain Hallé
Enter BeepBeep
                 2

                     MyApplication.com




Sylvain Hallé
Enter BeepBeep
                 2

                     MyApplication.com




Sylvain Hallé
Enter BeepBeep


                     MyApplication.com




Sylvain Hallé
Enter BeepBeep


                     MyApplication.com




Sylvain Hallé
Adding BeepBeep to a real application




Sylvain Hallé
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Π     Copy BeepBeep to application folder
            http://beepbeep.sourcef...
Adding BeepBeep to a real application

     Ž      Obtain (or create) a contract file with LTL-FO+ formulae
      # ------...
Quick demo




Sylvain Hallé
Experimental results

   Sample property: "each car entering in a parking lot must exit
   before entering again"

       ...
Experimental results

   Simultaneous monitoring of 11 properties (Amazon example)


                                     ...
Experimental results

   Simultaneous monitoring of 11 properties (Amazon example)


                                     ...
Take-home points




Sylvain Hallé
Take-home points

   1. Constraints involving temporal operators and quantification
      on message contents arise natura...
Take-home points

   1. Constraints involving temporal operators and quantification
      on message contents arise natura...
Take-home points

   1. Constraints involving temporal operators and quantification
      on message contents arise natura...
Take-home points

   1. Constraints involving temporal operators and quantification
      on message contents arise natura...
Upcoming SlideShare
Loading in …5
×

Browser-Based Enforcement of Interface Contracts in Web Applications with BeepBeep (Talk @ CAV 2009)

605 views

Published on

BeepBeep is a lightweight runtime monitor for AJAX web applications. It transparently checks in real time whether XML messages received and sent by the application satisfy a predefined interface specification.

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

  • Be the first to like this

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

No notes for slide

Browser-Based Enforcement of Interface Contracts in Web Applications with BeepBeep (Talk @ CAV 2009)

  1. 1. Browser-based Enforcement of Interface Contracts in Web Applications with BeepBeep Sylvain Hallé, Roger Villemaire University of California Université du Québec à Montréal Santa Barbara, USA Montréal, CANADA Sylvain Hallé
  2. 2. Some web services E-Commerce Service Compute Cloud PayPal API: billing, express checkout Shopping: like Amazon Google Search, Google Maps, GMail, ... Sylvain Hallé
  3. 3. Using web applications MyApplication.com Sylvain Hallé
  4. 4. Using web applications MyApplication.com Sylvain Hallé
  5. 5. Using web applications i ? MyApplication.com Sylvain Hallé
  6. 6. Using web applications i ? MyApplication.com 1. 2. ... Sylvain Hallé
  7. 7. Using web applications XML request <ListItems> MyApplication.com <title>birds</title> </ListItems> <Items> <Item> <ID>1</ID> <Title>abc</Title> </Item> ... XML </Items> response Sylvain Hallé
  8. 8. Using web applications 2 MyApplication.com Sylvain Hallé
  9. 9. Using web applications 2 MyApplication.com c Sylvain Hallé
  10. 10. Using web applications XML request <cartCreate> MyApplication.com <item>2</item> </cartCreate> <cart> <id>c</id> <items> <item>2</item> </items> </cart> XML response Sylvain Hallé
  11. 11. Using web applications 2 c MyApplication.com Sylvain Hallé
  12. 12. Using web applications 2 c MyApplication.com Sylvain Hallé
  13. 13. Constraints on the message trace Sylvain Hallé
  14. 14. Constraints on the message trace i ? Sylvain Hallé
  15. 15. Constraints on the message trace i ? 1. 2. ... Sylvain Hallé
  16. 16. Constraints on the message trace 2 i ? 1. 2. ... c Sylvain Hallé
  17. 17. Constraints on the message trace 2 2 i ? c 1. 2. ... c Sylvain Hallé
  18. 18. Constraints on the message trace You cannot add the same item twice to the shopping cart 2 2 i ? c 1. 2. ... c Sylvain Hallé
  19. 19. Constraints on the message trace You cannot add the same item twice to the shopping cart 2 2 i ? c ??? 1. 2. ... c Sylvain Hallé
  20. 20. Constraints on the message trace ??? Sylvain Hallé
  21. 21. Constraints on the message trace ??? Sylvain Hallé
  22. 22. Constraints on the message trace You cannot add the same item twice to the shopping cart 2 2 c ! Atoms are properties over messages... Sylvain Hallé
  23. 23. Constraints on the message trace You cannot add the same item twice to the shopping cart G ( 2 Þ ØF 2 c ( ! Atoms are properties over messages... ! + LTL operators... Sylvain Hallé
  24. 24. Constraints on the message trace You cannot add the same item twice to the shopping cart ( G "i i Þ ØF i c ( ! Atoms are properties over messages... ! + LTL operators... ! + quantification on elements Sylvain Hallé
  25. 25. Constraints on the message trace You cannot add the same item twice to the shopping cart ( G "i i Þ ØF i c ( ! Atoms are properties over messages... ! + LTL operators... ! + quantification on elements } LTL-FO+ Sylvain Hallé
  26. 26. Enter BeepBeep MyApplication.com Sylvain Hallé
  27. 27. Enter BeepBeep MyApplication.com Sylvain Hallé
  28. 28. Enter BeepBeep ( G "i i Þ ØF i c ( MyApplication.com Sylvain Hallé
  29. 29. Enter BeepBeep 2 MyApplication.com Sylvain Hallé
  30. 30. Enter BeepBeep MyApplication.com Sylvain Hallé
  31. 31. Enter BeepBeep 2 MyApplication.com Sylvain Hallé
  32. 32. Enter BeepBeep 2 MyApplication.com Sylvain Hallé
  33. 33. Enter BeepBeep MyApplication.com Sylvain Hallé
  34. 34. Enter BeepBeep MyApplication.com Sylvain Hallé
  35. 35. Adding BeepBeep to a real application Sylvain Hallé
  36. 36. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net Sylvain Hallé
  37. 37. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net  Include BeepBeep Sylvain Hallé
  38. 38. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net  Include BeepBeep myapplication.html <html> <head> <title>My Application </title> <script type="text/javascript" href="myapplication.js"/> </head> <body> ... </body> </html> Sylvain Hallé
  39. 39. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net  Include BeepBeep myapplication.html <html> <head> <title>My Application </title> <script type="text/javascript" href="myapplication.js"/> <script type="text/javascript" href="beepbeep.js"/> </head> <body> ... </body> </html> Sylvain Hallé
  40. 40. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net  Include BeepBeep myapplication.html myapplication.js <html> <head> // Initializations <title>My Application ... </title> <script type="text/javascript" req = new XMLHttpRequest(); href="myapplication.js"/> <script type="text/javascript" ... href="beepbeep.js"/> </head> function abc() <body> { ... ... </body> req.send(some_message); </html> } Sylvain Hallé
  41. 41. Adding BeepBeep to a real application Œ Copy BeepBeep to application folder http://beepbeep.sourceforge.net  Include BeepBeep myapplication.html myapplication.js <html> <head> // Initializations <title>My Application ... </title> <script type="text/javascript" req = new XMLHttpRequestBB(); href="myapplication.js"/> <script type="text/javascript" ... href="beepbeep.js"/> </head> function abc() <body> { ... ... </body> req.send(some_message); </html> } Sylvain Hallé
  42. 42. Adding BeepBeep to a real application Ž Obtain (or create) a contract file with LTL-FO+ formulae # --------------------------------------------------------------- # BeepBeep contract file for the Amazon ECS # --------------------------------------------------------------- % To create a cart, you must put at least one item ; G ([x1 /CartCreate/Operation] (((x1) = ({CartCreate})) -> (<x2 /CartCreate/Items/Item/ASIN> ({TRUE})))) % You can only create a cart once ; G ([x1 /CartCreate/Operation] (((x1) = ({CartCreate})) -> (X (G (!(<x2 /CartCreate/Operation> ((x2) = ({CartCreate})))))))) % No CartAdd can occur before a CartCreate ; (!(<x1 /CartAdd/Operation> ((x1) = ({CartAdd})))) U (<x2 /CartCreate/Operation> ((x2) = ({CartCreate}))) % You cannot add the same item twice to the shopping cart ; G ([i /CartCreate/Items/Item/ASIN] (X (G ([j /CartAdd/Items/Item/ASIN] (!((i) = (j))))))) Sylvain Hallé
  43. 43. Quick demo Sylvain Hallé
  44. 44. Experimental results Sample property: "each car entering in a parking lot must exit before entering again" < 5 ms/msg. Time per message (ms) Trace length Hallé & Villemaire, EDOC 2008 Sylvain Hallé
  45. 45. Experimental results Simultaneous monitoring of 11 properties (Amazon example) 20 < 5% Time difference (%) 10 Moyenne 0 -10 -20 0 20 40 60 80 100 120 140 160 180 200 Trace length Sylvain Hallé
  46. 46. Experimental results Simultaneous monitoring of 11 properties (Amazon example) 14 Time per message (ms) 12 Data domain 10 25 8 200 6 4 2 0 0 20 40 60 80 100 120 140 160 Trace length Sylvain Hallé
  47. 47. Take-home points Sylvain Hallé
  48. 48. Take-home points 1. Constraints involving temporal operators and quantification on message contents arise naturally in real web applications Sylvain Hallé
  49. 49. Take-home points 1. Constraints involving temporal operators and quantification on message contents arise naturally in real web applications 2. An extension of LTL can formalize them: LTL-FO+ Sylvain Hallé
  50. 50. Take-home points 1. Constraints involving temporal operators and quantification on message contents arise naturally in real web applications 2. An extension of LTL can formalize them: LTL-FO+ 3. Runtime monitoring of these constraints can be done efficiently, even with quantification Sylvain Hallé
  51. 51. Take-home points 1. Constraints involving temporal operators and quantification on message contents arise naturally in real web applications 2. An extension of LTL can formalize them: LTL-FO+ 3. Runtime monitoring of these constraints can be done efficiently, even with quantification 4. BeepBeep is a tool that allows it with minimal modifications on real applications http://beepbeep.sourceforge.net/ Sylvain Hallé

×