191
Sylvain Hallé Sylvain Hallé and Roger Villemaire Runtime Verification for the Web A Tutorial Introduction to Interface Contracts in Web Applications . Université du Québec à Chicoutimi CANADA Université du Québec à Montréal CANADA Fonds de recherche sur la nature et les technologies CRSNG NSERC

Runtime Verification for the Web (RV 2010 Tutorial)

Embed Size (px)

DESCRIPTION

Web service message contracts are constraints on the values and sequences of XML messages that can be exchanged between a client’s web browser and an application server. This tutorial presents BeepBeep, a lightweight Java monitor that can check and enforce message contracts expressed as LTL formulae with first-order quantification over data fields. Its use is illustrated on real world web applications submitted to these kinds of contracts.

Citation preview

Page 1: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Sylvain Hallé and Roger Villemaire

Runtime Verification for the Web

A Tutorial Introduction to Interface Contractsin Web Applications

.

Université du Québec à ChicoutimiCANADA

NOSHOW

Université du Québec à MontréalCANADA

Fonds de recherchesur la natureet les technologies

CRSNGNSERC

Page 2: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Web applications and cloud computing: a growing part of computing systems

Very simple protocols: no state, only basic type checking, the rest is up to the developers

Loose couplingg of components: nice but comes with problems!

Few works on verification / enforcement of web applications

A ‘‘call to arms’’ to the community: interesting opportunities for application of RV

Why this tutorial?

Page 3: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Part One: The basics of web applications

?What is a web application?An example: the Beep StoreConstraints and problems

Part Two: Interface contracts in web applications

Characterizing constraintsFormalizing constraintsMonitoring constraintsDoing this for real: back to the Beep StoreWhat’s next?

??

?????

Tutorial overview

Page 4: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Part One

The basics of web applications

Page 5: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Desktop computing

SHOW

Page 6: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Desktop computing

NOINC

Page 7: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Cloud computingCloud computing

Page 8: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Cloud computingCloud computing

Page 9: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Cloud computingCloud computing

Network connection

Page 10: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Cloud computingA static web site

Page 11: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

NOINC

Bee G

Beatles

Camel

Caravan

Page 12: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

Bee G

Beatles

Camel

Caravan

beatles.html

NOINC

Page 13: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

NOINC

Page 14: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

NOINC

Page 15: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

Sear

ch

The

Beep

Stor

e

Wha

t is th

is?

Login

Ask fo

r acc

ount

Conta

ct us

Versio

n inf

o

beatles.html

NOINC

Page 16: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

Sear

ch

The

Beep

Stor

e

Wha

t is th

is?

Login

Ask fo

r acc

ount

Conta

ct us

Versio

n inf

o

beatles.html

<html>

<h1></h1>

</html>

...Results for

Beatles...

NOINC

Page 17: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA static web site

Sear

ch

The

Beep

Stor

e

Wha

t is th

is?

Login

Ask fo

r acc

ount

Conta

ct us

Versio

n inf

o

beatles.html

<html>

<h1></h1>

</html>

...Results for

Beatles...

COnly page rendering instructions are sent

NOINC

Page 18: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

SHOW

Bee G

Beatles

Camel

Caravan

Page 19: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computing

Bee G

Beatles

Camel

Caravan

page.php?artist beatles=

A dynamic web site

NOINC

Page 20: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

NOINC

Page 21: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

NOINC

Page 22: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

NOINC

Page 23: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

artist beatles=

NOINC

Page 24: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

artist beatles=

NOINC

Page 25: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

artist beatles=

NOINC

Page 26: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

artist beatles=

Sear

ch

The

Beep

Stor

e

Wha

t is th

is?

Login

Ask fo

r acc

ount

Conta

ct us

Versio

n inf

o

NOINC

Page 27: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingA dynamic web site

CContent is generated programatically based on user input

artist beatles=

Sear

ch

The

Beep

Stor

e

Wha

t is th

is?

Login

Ask fo

r acc

ount

Conta

ct us

Versio

n inf

o

NOINC

Page 28: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Cloud computingAjax web application

Page 29: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

JavaScript

NOINC

Page 30: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

Bee G

Beatles

Camel

Caravan

NOINC

Page 31: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

Bee G

Beatles

Camel

Caravan

<a onclick=>

"javascript: findBand(’ ’)"Beatles

NOINC

Page 32: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

findBand(’Beatles’)

NOINC

Page 33: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

findBand(’Beatles’)

NOINC

Page 34: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

findBand(’Beatles’)

artist beatles=

NOINC

Page 35: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

findBand(’Beatles’)

artist beatles=

NOINC

Page 36: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

document.innerHTML = findBand(’Beatles’)

artist beatles=

NOINC

Page 37: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

document.innerHTML = findBand(’Beatles’)

artist beatles=

CPage is updated, not reloaded

NOINC

Page 38: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

findBand(’Beatles’)

artist beatles=

CServer response only provides updated contents

document.innerHTML =

NOINC

Page 39: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Ajax web applications: examples

Microsoft Office Live

Page 40: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Ajax web applications: examples

eyeOS

SHOW

Page 41: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Ajax web applications: examples

Chrome OS

SHOW

Page 42: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Cloud computingAjax web application

Does not needto be a URL

Does not needto be HTML

Page 43: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Cloud computingAjax web application

Does not needto be a URL

Does not needto be HTML

<Search>

</Search>

beatles

<Artist>

</Artist>

Page 44: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application

Does not needto be a URL

Does not needto be HTML

<SearchResults>

</SearchResults>

The Beatles Rubber Soul ...

<Item>

</Item>

<Artist>

</Artist><Title>

</Title>

<Search>

</Search>

beatles

<Artist>

</Artist>

NOINC

Page 45: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingAjax web application<Search>

</Search>

beatles

<Artist>

</Artist> XMLThe eXtensible Markup

Language

?Nested collection ofelements

?Input/output data issemi-structured

.

.

<SearchResults>

</SearchResults>

The Beatles Rubber Soul ...

<Item>

</Item>

<Artist>

</Artist><Title>

</Title>

NOINC

Page 46: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Cloud computingConceptually...

Page 47: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

NOINC

Page 48: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

NOINC

Page 49: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

NOINC

Page 50: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

NOINC

Page 51: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

NOINC

Page 52: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Cloud computingConceptually...

Web serviceWeb client

NOINC

Page 53: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

An example: the Beep Store

? tutorial application

?Fake CD catalog + web service+ web client

?Functionalities typical of applications we studied

  

?Examples:

  Session login/logout  Shopping cart operations

Purpose-built

SQLite PHPJavaScript

real-world

.

..

.

.

TheBeepStore

GO

Sign in or register

What is this?

Login

Ask for account

Contact us

Fault parameters

Search: Your Cart

Search results for ‘Beatles’

Rubber SoulThe Beatles

Yellow SubmarineThe Beatles

Page 54: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Main issue

SHOW

Possible between messages sent and messages expected

mismatch

Not like traditional programming: all input-output is exchanged unverified!

Page 55: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Defining message formats

SHOW

?

Page 56: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1.

2.

...

?

Defining message formats

NOINC

Page 57: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1.

2.

...

<ItemSearch>

</ItemSearch> beatles<Artist> </object>

Defining message formats

NOINC

Page 58: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch> beatles<Artist> </object>

<ItemSearchResponse> <Items>

</Items></ItemSearchResponse>

Help!The Beatles

<Item>

</Item> ...

<Title> </no> <Artist> </Artist>

Defining message formats

NOINC

Page 59: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

<ItemSearch>

</ItemSearch> beatles<Artist> </object>

<ItemSearchResponse> <Items>

</Items></ItemSearchResponse>

Help!The Beatles

<Item>

</Item> ...

<Title> </no> <Artist> </Artist>

XML request

XML response

Defining message formats

Page 60: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch> beatles<Artist> </object>

ItemSearch[ [string]]Artist

<ItemSearchResponse> <Items>

</Items></ItemSearchResponse>

Help!The Beatles

<Item>

</Item> ...

<Title> </no> <Artist> </Artist>

XML request

XML response

Defining message formats

NOINC

Page 61: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch> beatles<Artist> </object>

ItemSearch[ [string]]Artist

ItemSearchResponse[ [ Item[ Title[string], Artist[string] ]{0,¥} ]]

Items<ItemSearchResponse> <Items>

</Items></ItemSearchResponse>

Help!The Beatles

<Item>

</Item> ...

<Title> </no> <Artist> </Artist>

XML request

XML response

Defining message formats

NOINC

Page 62: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

ItemSearch[ [string]]Artist

ItemSearchResponse[ [ Item[ Title[string], Artist[string] ]{0,¥} ]]

Items

?

!

Defining message formats

NOINC

Page 63: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Defining message formats

WSDL: Web Service Description Language

ItemSearch[ [string]]Artist

CartCreate[ [int], [int], [ Item[ Title[string], Artist[string] ]{0,¥} ]]

ItemsSessionKeyItems

?

?

ItemSearchResponse[ [ Item[ Title[string], Artist[string], ]{0,¥} ]]

Items

CartCreateResponse[ [int], [int], [ Item[ Title[string], Artist[string] ]{0,¥} ]]

SessionKeyCartIdItems

!

!

. . .

Page 64: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl

https://www.paypal.com/wsdl/PayPalSvc.wsdl

http://api.google.com/GoogleSearch.wsdl

WSDLs for real world web services

Page 65: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

<ItemSearch>

</ItemSearch>

beatles 1234<Artist> </Artist><Bizbiz> </Bizbiz>

Defining message formats

Page 66: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch>

beatles 1234<Artist> </Artist><Bizbiz> </Bizbiz>

Defining message formats

ItemSearch[ [string]]Artist vs.?

NOINC

Page 67: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch>

beatles 1234<Artist> </Artist><Bizbiz> </Bizbiz>

Defining message formats

ItemSearch[ [string]]Artist vs.?

NOINC

Page 68: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<ItemSearch>

</ItemSearch>

beatles 1234<Artist> </Artist><Bizbiz> </Bizbiz>

Defining message formats

ItemSearch[ [string]]Artist vs.?

NOINC

Page 69: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

<CartCreateResponse> <SessionKey> </SessionKey> <CartId> </CartId> <Items>

</Items></ItemSearchResponse>

1234

abc

...

Defining message formats

Page 70: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<CartCreateResponse> <SessionKey> </SessionKey> <CartId> </CartId> <Items>

</Items></ItemSearchResponse>

1234

abc

...

Defining message formats

CartCreateResponse[ [int], [int], [ Item[ Title[string], Artist[string] ]{0,¥} ]]

SessionKeyCartIdItems

vs.

!

NOINC

Page 71: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<CartCreateResponse> <SessionKey> </SessionKey> <CartId> </CartId> <Items>

</Items></ItemSearchResponse>

1234

abc

...

Defining message formats

CartCreateResponse[ [int], [int], [ Item[ Title[string], Artist[string] ]{0,¥} ]]

SessionKeyCartIdItems

vs.

!

NOINC

Page 72: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

<CartCreateResponse> <SessionKey> </SessionKey> <CartId> </CartId> <Items>

</Items></ItemSearchResponse>

1234

abc

...

Defining message formats

CartCreateResponse[ [int], [int], [ Item[ Title[string], Artist[string] ]{0,¥} ]]

SessionKeyCartIdItems

vs.

!

NOINC

Page 73: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

What happened?

Page 74: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

?

What happened?

NOINC

Page 75: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

?

What happened?

NOINC

Page 76: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1.

2.

...

What happened?

NOINC

Page 77: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1.

2.

...

What happened?

NOINC

Page 78: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

2What happened?

NOINC

Page 79: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

c

What happened?

NOINC

Page 80: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

2

c

What happened?

NOINC

Page 81: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

What happened?

NOINC

Page 82: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

?2

c

2

c

Interface contracts

All messages comply with the WSDL but...

1.

2.

...

SHOW

Page 83: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

?2

c

2

c

Interface contracts

You cannot add the same itemtwice to the shopping cart

All messages comply with the WSDL but...

1.

2.

...

NOINC

Page 84: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

?2

c

2

c

Interface contracts

???

You cannot add the same itemtwice to the shopping cart

All messages comply with the WSDL but...

1.

2.

...

NOINC

Page 85: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Interface contracts

???

NOINC

Page 86: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

???

Interface contracts

NOINC

Page 87: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Free-form messages

Stateful interactions, stateless protocols

No uniform contract notation

Constraints at message level

XML, but that’s about it. No assumptions on nesting,degree, etc.

HTTP / SOAP define only message structureNo protocol enforces sequential constraints

Plain-text documentation... but OWL, RDF, ...

Components are black boxes (e.g. Amazon)

What are the issues?

Page 88: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

The big question

SHOW

Prevent contract

violations

Page 89: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1. A priori certification

A trustworthy authority assesses the client’s compliance to the contract...

A first solution

SHOW

Testing, staticverificationetc.

Page 90: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1. A priori certification

A trustworthy authority assesses the client’s compliance to the contract...

...and grants a digital certificate

NOINC

A first solution

Page 91: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1. A priori certification

NOINC

A+

The service needs a certificate to start an exchange with a client

A first solution

Page 92: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

The service needs a certificate to start an exchange with a client

Example: iPhone app certification

1. A priori certification

NOINC

A+

A first solution

Page 93: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1. A priori certification

NOINC

Z+

Problem: the client can change after certification

iPhone jailbreaking,Javascript prototype hijacking, ...

A first solution

Page 94: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Proposed approach

SHOW

2. Client-side RuntimeMonitoring

A separate process checks each message...

CONTRACT

Page 95: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

A

SHOW

2. Client-side RuntimeMonitoring

A separate process checks each message...

CONTRACT

Proposed approach

Page 96: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

A

SHOW

The message is relayed to the web service proper when it complies with the contract

2. Client-side RuntimeMonitoring

A separate process checks each message...

Proposed approach

Page 97: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

2. Client-side RuntimeMonitoring

A separate process checks each message...

SHOW

...and is discarded when it violates the contract

Proposed approach

Page 98: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

A web service interacts with a web client through the exchange of semi-structured XML documents called

The service and client are generally designed by

No verification is done on the incoming and outgoing messages: possible between sent and expected messages (in both directions)

A priori checking of a client for compliance isvery hard, if not impossible

Runtime monitoring is a possible solution

messages

different organisations

mismatch

.

.

.

.

Summary (I)

SHOW

Page 99: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOSHOW

Part Two

Interface contracts inweb applications

Page 100: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Interface contracts

All possible sequences of all possibles messages with all possible values

Page 101: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Interface contracts

Constraintson individualmessages

Page 102: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Interface contracts

Constraintson sequencesConstraints

on individualmessages

Page 103: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Interface contracts

Constraintson sequences

Data-awaresequential constraints

Constraintson individualmessages

Page 104: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOINC

Interface contracts

Interface contract =valid (error-free) interactions

Constraintson sequences

Data-awaresequential constraints

Constraintson individualmessages

Page 105: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Interface contracts

As a tutorial tool, the Beep Store’s JavaScript client can be told to ‘‘forget’’ elements of the service’s interface contract

TheBeepStore

GO

Sign in or register

What is this?

Login

Ask for account

Contact us

Fault parameters

Search: Your Cart

Fault parameters

Don’t check Results’s typeIn the detailed search form, sends an ItemSearch message withoutchecking that the Results element is an integer.

"Add to cart" enabled if item present in cartMakes the "Add to cart" button available for items that are already in theuser's cart.

Message schemas

Cart manipulations

Highlightsdocumentation

Disables theverification

Page 106: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

NOSHOW

Interface contracts

Dave, my mindis going...

As a tutorial tool, the Beep Store’s JavaScript client can be told to ‘‘forget’’ elements of the service’s interface contract

Page 107: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on individual messages

Examples:

Three types of constraints (I)

SHOWSHOW

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Page 108: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on individual messages

Examples:

Three types of constraints (I)

SHOWSHOW

1. The element must be an integer between 1 and 20.Page "/M

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Page 109: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Three types of constraints (I)

SHOWSHOW

1. The element must be an integer between 1 and 20.

2. The element is mandatory only if is present,otherwise it is forbidden.

Page

Page Results

"/M

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Constraints on individual messages

Examples:

Page 110: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Expressing data constraints

Simple XPathFetches portions of an XML document according to aquery path = sequence of tags

: set of messages: set of XML query paths: set of atomic values

: ́ ® 2

Examples:(‘‘/a/b/c’’, m) = {1,2,4}(‘‘/a/b/d’’, m) = Æ

M

M

Q

Q

V

Vp

pp

SHOW

m

{

<a> <b> <c>1</c> <c>2</c> </b> <d> <c>9</c> </d> <b> <c>3</c> </b></a>

Page 111: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Expressing data constraints

XPath termExpresses properties over values fetched by XPath expressions

For some message Î , path Î ,

" x : j(x) Û j(v) for every Î ( , )

$ x : j(x) Û j(v) for some Î ( , )

Examples:" x : x < 5/a/b/c

$ x :/a/b

$ x : " y : y £ x/a/b/c /a/b/c

m M

mq

mq

q Q

q

q

v

v

p

p

2

SHOW

<a> <b> <c>1</c> <c>2</c> </b> <d> <c>9</c> </d> <b> <c>3</c> </b></a>

m

{

Page 112: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Expressing data constraints

2

SHOW

1. The element must be an integer between 1 and 20.

2. The element is mandatory only if is present,otherwise it is forbidden.

Page

Page Results

"/M

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Page 113: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Expressing data constraints

2

SHOW

1. " x : x > 0 Ù x < 21/Message/Page

2. The element is mandatory only if is present,otherwise it is forbidden.

Page Results

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Page 114: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Expressing data constraints

2

SHOW

1. " x : x > 0 Ù x < 21/Message/Page

2. $ x : Û $ y : /Message/Page /Message/Results

<Message> <Action>ItemSearch</Action> <Results>5</Results> <Keyword>beatles</Keyword> <Page>1</Page></Message>

Page 115: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

Page 116: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. The request cannot be resent if its response is

successful..

Login "/

"/

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Page 117: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. The request cannot be resent if its response is

successful..

4. must follow a successful LoginResponse.

Login

CartCreate

"/

"/

"/

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Page 118: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Linear Temporal Logic

Alphabet (A)Set of possible messages

Trace (A*)Sequence of messages

Page 119: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

LTL formula = assertion on the of states in a tracesequence

a "always a" a "a in the next" a "eventually a"

a b "a until b"

GXF

W

Linear Temporal Logic

G (a ® b)X (d cÚ e) WØFALSE TRUE

. . .A A EC CDB B

Page 120: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Well-known results:

1. For every LTL formula j, there exists a Büchi automaton Asuch that for every (infinite) trace s:

i.e. LTL describes languages

2. The alphabet symbols can be generalized to finite sets ofBoolean propositions

w-regular

Þ Let’s use XPath terms as our Boolean propositions

Linear Temporal Logic

j

s |= j Û s Î L(A )j

Page 121: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. The request cannot be resent if its response is

successful..

4. must follow a successful LoginResponse.

Login

CartCreate

"/

"/

"/

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Page 122: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. (" a : a = LoginResponse ®/Message/Action

( " a’ : a’ ¹ Login))/Message/Action.

4. must follow a successful LoginResponse.

G

X G

CartCreate "/

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Page 123: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. (" a : a = LoginResponse ®/Message/Action

( " a’ : a’ ¹ Login))/Message/Action.

4. must follow a successful LoginResponse.

G

X G

CartCreate "/

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Xpath terms

Page 124: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Constraints on message sequences

Examples:

2

SHOW

3. (" a : a = LoginResponse ®/Message/Action

( " a’ : a’ ¹ Login))/Message/Action

4. (" a : a ¹ CartCreate)/Message/Action

(" a’ : a’ = LoginResponse)/Message/Action

G

X G

W

.

<Message> <Action> Login </Action> ...</Message>

<Message> <Action> LoginResponse </Action> ...</Message>

<Message> <Action> CartCreate </Action> ...</Message>

Three types of constraints (II)

X

Xpath terms

Page 125: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

The verification can be separated in two steps

Three types of constraints (II)

G

X

Ú

"$

$ G

F

®

1. Temporal stepDetermine termporal relationships to current message

2. Data stepEvaluate relevant XPath terms on message

Page 126: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 127: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

j

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 128: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s =

j

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 129: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = a

j

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 130: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = a

ja

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 131: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = ab

ja

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 132: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = ab

ja b

b

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 133: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = aba

ja b

b

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 134: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

s = aba

ja

a

a

b

b

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is readon-the-fly

Page 135: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Gerth, Peled, Vardi, Wolper (PSTV 1995): construction of a Büchi automaton from a given LTL formula j

Benefit:

" ": automaton states are built as thetrace is read

Dead end: formula is false

on-the-fly

Runtime monitoring

s = aba

ja

a

a

b

b

Page 136: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Runtime monitoring

Algorithm overview:

1. An LTL formula is decomposed into nodes of the form

sub-formulas thatmust be true now

sub-formulas that mustbe true in the next state

Page 137: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Algorithm overview:

1. An LTL formula is decomposed into nodes of the form

Example:

sub-formulas thatmust be true now

sub-formulas that mustbe true in the next state

Runtime monitoring

Page 138: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

2. Negations pushed inside (classical identities + dual of U = V)

3. At the leaves, G contains atoms + negations of atoms:we evaluate them

Verdict:

! All leaves contain : formula is false! A leaf is : formula is true! Otherwise:

4. Next event: D copied into G and we continue

FALSEempty

Runtime monitoring

Page 139: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

Runtime monitoring

Page 140: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

G (a ® b)X ?

Runtime monitoring

Page 141: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

G (a ® b)X ?

a ® bX G (a ® b)X?

Runtime monitoring

Page 142: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

G (a ® b)X ?

Øa G (a ® b)X?

a ® bX G (a ® b)X?

Runtime monitoring

Page 143: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

G (a ® b)X ?

a, X b G (a ® b)X?Øa G (a ® b)X?

a ® bX G (a ® b)X?

Runtime monitoring

Page 144: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

G (a ® b)X ?

a, X b G (a ® b)X?

a G (a ® b), bX?

Øa G (a ® b)X?

a ® bX G (a ® b)X?

Runtime monitoring

Page 145: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

a G (a ® b), bX?

Øa G (a ® b)X?

Runtime monitoring

Page 146: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a G (a ® b), bX?

Øa G (a ® b)X?

Runtime monitoring

Page 147: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a G (a ® b), bX?

Øa G (a ® b)X?

Runtime monitoring

Page 148: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a G (a ® b), bX?

Runtime monitoring

Page 149: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

G (a ® b), bX?

Runtime monitoring

Page 150: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

?G (a ® b), bX

G (a ® b), bX?

Runtime monitoring

Page 151: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a, X b, b G (a ® b)X?

a, b G (a ® b), bX?

Øa, b G (a ® b)X?

a ® b, bX G (a ® b)X?

?G (a ® b), bX

Runtime monitoring

Page 152: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a, b G (a ® b), bX?

Øa, b G (a ® b)X?

Runtime monitoring

Page 153: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

a, b G (a ® b), bX?

Øa, b G (a ® b)X?

Runtime monitoring

Page 154: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = a

Øa, b G (a ® b)X?

Runtime monitoring

Page 155: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = ac

Øa, b G (a ® b)X?

Runtime monitoring

Page 156: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = ac

Øa, b G (a ® b)X?

Runtime monitoring

Page 157: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Example: G (a ® b)X

s = ac

No way to extend the trace:formula is false

Runtime monitoring

Page 158: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Examples:

2

SHOW

5. There can be at most one active cart ID per session key."/

Three types of constraints (III)

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

Page 159: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Examples:

2

SHOW

5. (" k : " c : /Message/SessionKey /Message/CartId

(" k’ : " c’ : /Message/SessionKey /Message/CartId

k = k’ ® c = c’))

G

G

Three types of constraints (III)

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

Page 160: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Examples:

2

SHOW

5. (" k : " c : /Message/SessionKey /Message/CartId

(" k’ : " c’ : /Message/SessionKey /Message/CartId

k = k’ ® c = c’))

G

G

Three types of constraints (III)

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

<Message> <SessionKey>123</SessionKey> <CartId>789</CartId> ...</Message>

Page 161: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Three types of constraints (III)

2

SHOW

5. (" k : " c : /Message/SessionKey /Message/CartId

(" k’ : " c’ : /Message/SessionKey /Message/CartId

k = k’ ® c = c’))

G

G

Page 162: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

·XPath terms and temporal operators aremixed

.

·Not just ‘‘LTL with syntactical sugar’’.

·Not just a pathological case

5. (" k : " c : /Message/SessionKey /Message/CartId

(" k’ : " c’ : /Message/SessionKey /Message/CartId

k = k’ ® c = c’))

G

G

Three types of constraints (III)

2

SHOW

G

G

"

"

k

Page 163: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Examples:

2

SHOW

6. You cannot add the same item twice to the shopping cart."/

Three types of constraints (III)

<Message> <Action>CartAdd</Action> <Items> <Item> <ItemId>567</ItemId> ...

<Message> <Action>CartAdd</Action> <Items> <Item> <ItemId>567</ItemId> ...

X

Page 164: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Data-aware sequential constraints

Examples:

2

SHOW

6. (" a : a = CartAdd ®/Message/Action

" i : (" a’ :/Message/ItemId /Message/Action

a’ = CartAdd ® " i’ : i ¹ i’ ))/Message/ItemId

G

X G

Three types of constraints (III)

<Message> <Action>CartAdd</Action> <Items> <Item> <ItemId>567</ItemId> ...

<Message> <Action>CartAdd</Action> <Items> <Item> <ItemId>567</ItemId> ...

X

Page 165: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Quantification must be relative to the values in the current message, and not the whole set V of possible values!

Example: ‘‘In every message, the a parameter must equal the b parameter’’. Suppose V = {1,2}, and classical first-order quantification.

Runtime monitoring

" x : " y : x = ya b

(" y : 1 = y) Ù (" y : 1 = y)b b

( 1 = 1) Ù ( 1 = 2) Ù ( 1 = 1) Ù ( 1 = 2)

Contradiction

G

G G

G G G G

Page 166: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

LTL-FO+

current

(Hallé & Villemaire, EDOC 2008)Extension of LTL with (limited) first-order quantification on message elements

·Boolean and LTL operators keep their original meaning·An XPath term is always meant to refer to the

message in the trace

Runtime monitoring

Page 167: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Adaptation of the runtime monitoring algorithm to handle LTL-FO+:

1. Atoms become equality tests

2. Decomposition rules for quantifiers

(and vice versa)

Runtime monitoring

Page 168: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Six constraints for the Beep Store

Data-aware constraints

Constraints on message sequences

Constraints on individual messages

Page 169: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Six constraints for the Beep Store

1. The element must be an integer between 1 and 20.

2. The element is mandatory only if is present,otherwise it is forbidden.

Page

Page Results

Data-aware constraints

Constraints on message sequences

Page 170: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Six constraints for the Beep Store

1. The element must be an integer between 1 and 20.

2. The element is mandatory only if is present,otherwise it is forbidden.

3. The request cannot be resent if its response issuccessful.

4. must follow a successful LoginResponse.

Page

Page Results

Login

CartCreate

Data-aware constraints

Page 171: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

1. The element must be an integer between 1 and 20.

2. The element is mandatory only if is present,otherwise it is forbidden.

3. The request cannot be resent if its response issuccessful.

4. must follow a successful LoginResponse.

5. There can be at most one active cart ID per session key.

6. You cannot add the same item twice to the shopping cart.

Page

Page Results

Login

CartCreate

SHOW

Six constraints for the Beep Store

Page 172: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

SHOW

Why are web service contracts special?

1. Presence of data-aware constraints

·Cannot separate data part from temporal partin specification AND enforcement

2. Complex messages

·Arbitrary nested structure·Cannot say ‘ ItemId’’:

there are many!·Rules out languages that

merely freeze a value in avariable

‘the

<Message> <Action>CartAdd</Action> <Items> <Item> <ItemId>567</ItemId> ... </Item> <Item> <ItemId>789</ItemId> ... </Item> ... </Items></Message>

Page 173: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Enforcing interface contracts at runtime

NOINC

XMLHttpRequest

·JavaScript object·Provided by the browser·All communications to monitor

already centralized: ‘‘no’’instrumentation

Page 174: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Enforcing interface contracts at runtime

NOINC

XMLHttpRequestBB

Page 175: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Enforcing interface contracts at runtime

NOINC

XMLHttpRequestBB

XMLHttpRequestLTL-FO+algorithm

·Wrapper around original·Provides same methods·Checks messages before

relaying them

Page 176: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

myapplication.html

<html><head><title></title><script type=" " href=" "/>

</head><body>

</body></html>

My Application

...

text/javascriptmyapplication.js

?

�Include BeepBeep

Copy BeepBeep in the application's directoryhttp://beepbeep.sourceforge.net

Page 177: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

myapplication.html

<html><head><title></title><script type=" " href=" "/>

</head><body>

</body></html>

My Application

...

text/javascriptmyapplication.js

<script type="text/javascript" href="beepbeep.js"/>

?

�Include BeepBeep

Copy BeepBeep in the application's directoryhttp://beepbeep.sourceforge.net

Page 178: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

myapplication.html myapplication.js

<html><head><title></title><script type=" " href=" "/>

</head><body>

</body></html>

My Application

...

text/javascriptmyapplication.js

<script type="text/javascript" href="beepbeep.js"/>

// Initializations

= ();

(){

( );}

...

req XMLHttpRequest

...

abc

... req. some_message

new

function

send

?

�Include BeepBeep

Copy BeepBeep in the application's directoryhttp://beepbeep.sourceforge.net

Page 179: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

beepstore.html beepstore.js

<html><head><title></title><script type=" " href=" "/>

</head><body>

</body></html>

My Application

...

text/javascriptmyapplication.js

<script type="text/javascript" href="beepbeep.js"/>

// Initializations

= ();

(){

( );}

...

req

...

abc

... req. some_message

new

function

send

XMLHttpRequestBB

Include BeepBeep

?

Copy BeepBeep in the application's directoryhttp://beepbeep.sourceforge.net

Page 180: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Create a with LTL-FO+ formulascontract file ?

Add BeepBeep to an application

# -------------------------------------------------------# BeepBeep contract file for the Beep Store# -------------------------------------------------------

% The element Page must be an integer between 1 and 20.

% The element Page is mandatory only if Results is present, otherwise it is forbidden.

% The Login request cannot be resent if its response is successful.

; ( p /Message/Page (((p) > ({0})) ((p) < ({21}))))

; ( a /Message/Action (((a) = ({ItemSearch})) ( (( r /Message/Results ({TRUE}))

( p /Message/Page ({TRUE}))) (( p /Message/Page ({TRUE})) ( r /Message/Results ({TRUE}))))))

; ( a /Message/Action (((a) ({LoginResponse})) ( ( ( b /Message/Action ( ((b) ({Login}))))))))

G

G

GX G

[ ]

[ ]< >< >

< >< >

[ ][ ]

&

->->

&->

= ->! =

Caption: usedwhen violationsare discovered

Plain-textLTL-FO+(automaticallyparsed)

}

Page 181: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

When loading the application, BeepBeep starts as a smallJava applet inside the page

TheBeepStore

GO

Sign in or register

What is this?

Login

Ask for account

Contact us

Fault parameters

Search: Your Cart

Search results for ‘Beatles’

Rubber SoulThe Beatles

Yellow SubmarineThe Beatles

?/?/?/?/?/?:0:0

Page 182: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Add BeepBeep to an application

When loading the application, BeepBeep starts as a smallJava applet inside the page

TheBeepStore

GO

Sign in or register

What is this?

Login

Ask for account

Contact us

Fault parameters

Search: Your Cart

Search results for ‘Beatles’

Rubber SoulThe Beatles

Yellow SubmarineThe Beatles

?/?/?/?/?/?:0:0

Page 183: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

BeepBeep’s visible interface

?/?/?/?/?/?:0:0

Current state of monitorfor each property

Number ofmessagesprocessed

Cumulativeprocessingtime (in ms)

T: last message made it truet: is trueF: last message made it falsef: is false?: not yet true/false

Page 184: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

An interface contract provides constraints cover the of each XML message, their and their

An extension of Linear Temporal Logic including a limited form of quantification over message elements specifies them

of these constraints can be doneefficiently, even with quantification

BeepBeep is a tool that allows it with on real applications

formatcontents ordering

Runtime monitoring

minimal modifications

http://beepbeep.sourceforge.net/

Summary (II)

SHOW

Page 185: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Bounded-memory fragments of LTL

The forward-only fragment of LTL(Hallé & Villemaire, SAC 2009)

Applications to runtime monitoring of Java programs

Java-MOP plugin under construction

Symbolic (rather than explicit) handling of quantification

LTL with past operators

Standard web service mechanism for interface contracts?

.

.

SHOW

Open issues and interesting questions

Page 186: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Open issues and interesting questions

SHOW

In client-side monitoring...

NOINC

10

Page 187: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Open issues and interesting questions

SHOW

In client-side monitoring...

NOINC

...the server has no guarantee that monitoring actually takes place

ZZ

Z

10

Page 188: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

In server-side monitoring...

NOINC

9

Open issues and interesting questions

Page 189: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

In server-side monitoring...

NOINC

Too many clients may overwhelm the server’s verification process

9

Open issues and interesting questions

Page 190: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Processing savings ofclient-side monitoring

SHOW

Guarantees of server-sidemonitoring

11

Open issues and interesting questions

Page 191: Runtime Verification for the Web (RV 2010 Tutorial)

Sylvain Hallé

Processing savings ofclient-side monitoring

SHOW

11

Open issues and interesting questions

COOPERATIVERUNTIME MONITORING

Best paper award

S. Hallé, Cooperative runtime monitoringof LTL Interface Contracts. Proc. EDOC 2010.Guarantees of server-side

monitoring

COOPERATIVERUNTIME MONITORING