43
Recovering the Behaviour of AJAX Applications Ahmed E. Hassan Bram Adams Shane McIntosh Ying Zou

Recovering the Behaviour of AJAX Applications

  • Upload
    sailqu

  • View
    47

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Recovering the Behaviour of AJAX Applications

Recovering the Behaviour of AJAX

Applications

Ahmed E.

Hassan

BramAdams

ShaneMcIntosh

YingZou

Page 2: Recovering the Behaviour of AJAX Applications

Traditional Web App Model

User waits while theresponse is generated!

2

Page 3: Recovering the Behaviour of AJAX Applications

AJAX Web App Model

User may interact with the page while response is

prepared

XMLHttpRequest

3

Page 4: Recovering the Behaviour of AJAX Applications

Web app engineering is hard

4

Extraordinarytime pressure

[MacDonald:WWW:2001][Pressman:IEEE

Softw:17(1):2000]

Page 5: Recovering the Behaviour of AJAX Applications

Web app engineering is hard

5

Extraordinarytime pressure

SE Process isjust overhead!

Lack of SEProcess

Web Dev

[MacDonald:WWW:2001][Pressman:IEEE

Softw:17(1):2000]

Page 6: Recovering the Behaviour of AJAX Applications

Web app engineering is hard

6

Extraordinarytime pressure

SE Process isjust overhead!

Lack of SEProcess

Web Dev

Short EmployeeTurnover Rate

I think it’s time fora change of scenery

[MacDonald:WWW:2001][Pressman:IEEE

Softw:17(1):2000]

Page 7: Recovering the Behaviour of AJAX Applications

Consider the New Developer

Out-of-datedocumentatio

n /** * @author Bob * This routine always * returns true */ bool hasDoodad() {

return false; }

7

Page 8: Recovering the Behaviour of AJAX Applications

Consider the New Developer

Out-of-datedocumentatio

n /** * @author Bob * This routine always * returns true */ bool hasDoodad() {

return false; }

Lack of seniorpersonnel

“Bob no longer works here.”

8

Page 9: Recovering the Behaviour of AJAX Applications

MailSimilar

AJAX is everywhere!Instant

It is critical that these applications are carefully designed and maintained!

10

Page 10: Recovering the Behaviour of AJAX Applications

1. Code sharing

Recovering the Behaviour of AJAX

Apps

Feature 1 Feature 2

11

Page 11: Recovering the Behaviour of AJAX Applications

2. Robustness1. Code sharing

Feature 1 Feature 2

12

Recovering the Behaviour of AJAX

Apps

Page 12: Recovering the Behaviour of AJAX Applications

Exploratory case study

LOC

Domain AJAX fordecoration

Timemanagement

Socialnews

6,744 9,380 11,368

13

Page 13: Recovering the Behaviour of AJAX Applications

Is behaviour shared amongst AJAX app

features?

+DTrace

Navigate feature 1.

foo()bar()

14

Page 14: Recovering the Behaviour of AJAX Applications

Is behaviour shared amongst AJAX app

features?

+DTrace

Navigate feature 2.

foo()bar()

foo()baz()

Feature 1

15

Page 15: Recovering the Behaviour of AJAX Applications

Is behaviour shared amongst AJAX app

features?foo()bar()

foo()baz()

Feature 1 Feature 2

foo()

SharedBehaviour

bar()

Feature 1specific

Feature 2specific

baz()

16

Page 16: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

17

Page 17: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

18

UNSENT

Page 18: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

19

UNSENTOPENED

Page 19: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

20

UNSENTOPENED

HEADER_RECEIVED

Page 20: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

21

UNSENTOPENED

HEADER_RECEIVED

LOADING

Page 21: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

22

UNSENTOPENED

HEADER_RECEIVED

LOADINGDONE

Page 22: Recovering the Behaviour of AJAX Applications

Traces are Indexed by Connection State

foo()bar()

Feature 1

23

UNSENTOPENED

HEADER_RECEIVED

LOADINGDONE

Page 23: Recovering the Behaviour of AJAX Applications

Sequence Diagrams Show Shared and Feature Behaviour

Feature-specific

24

Page 24: Recovering the Behaviour of AJAX Applications

Sequence Diagrams Show Shared and Feature Behaviour

Feature-specific

25

Page 25: Recovering the Behaviour of AJAX Applications

Sequence Diagrams Show Shared and Feature Behaviour

Feature-specific

26

Page 26: Recovering the Behaviour of AJAX Applications

Feature-specific

27

Page 27: Recovering the Behaviour of AJAX Applications

Most behaviour is shared amongst

featuresXmlHttpRequest

State

80% 50%UNSENTOPENED

HEADER_RECEIVED

LOADINGDONE

100%100%100%100%

58%100%100%62%

29

Page 28: Recovering the Behaviour of AJAX Applications

Most behaviour is shared amongst

featuresXmlHttpRequest

State

80% 50%UNSENTOPENED

HEADER_RECEIVED

LOADINGDONE

100%100%100%100%

58%100%100%62%

30

Page 29: Recovering the Behaviour of AJAX Applications

Design Features are Revealed

31

Page 30: Recovering the Behaviour of AJAX Applications

Design Features are Revealed

32

Request BatchingMechanism

Page 31: Recovering the Behaviour of AJAX Applications

Design Features are Revealed

33

Page 32: Recovering the Behaviour of AJAX Applications

Design Features are Revealed

34

Flood preventiontechnique

Page 33: Recovering the Behaviour of AJAX Applications

•Most states share a lot of behaviour

•Guided inspection shows designs for reuse

35

Is behaviour shared amongst AJAX app

features?

Yes

Page 34: Recovering the Behaviour of AJAX Applications

+DTrace

Navigate feature.

foo()bar()

Are AJAX apps prepared for loss of

network connectivity?

36

Page 35: Recovering the Behaviour of AJAX Applications

+DTrace

Navigate feature.

foo()bar()

foo()err()

Standardworkflow

Are AJAX apps prepared for loss of

network connectivity?

37

Page 36: Recovering the Behaviour of AJAX Applications

foo()bar()

foo()err()

Errorworkflow

foo()

SharedBehaviour

bar() err()

Are AJAX apps prepared for loss of

network connectivity?Standardworkflow

Standardspecific

Errorspecific

38

Page 37: Recovering the Behaviour of AJAX Applications

Studied Apps Seem Unprepared for Lack of

Connectivity

Unsettling behaviour given the trend towardswireless and mobile networking!

Vote was notsent to the server!

39

Page 38: Recovering the Behaviour of AJAX Applications

Are AJAX apps prepared for loss of

network connectivity?

40

•UI state often out-of-sync with server

Inconclusive, but unsettling

Page 39: Recovering the Behaviour of AJAX Applications

Threats to Validity

No serverside

analysis41

Page 40: Recovering the Behaviour of AJAX Applications

Threats to Validity

No serverside

analysis

Obfuscated Javascript is not handled gracefully

42

Page 41: Recovering the Behaviour of AJAX Applications

Threats to Validity

AJAXprojects

No serverside

analysis

Obfuscated Javascript is not handled gracefully

43

Page 42: Recovering the Behaviour of AJAX Applications

Threats to Validity Studiedprojects

AJAXprojects

No serverside

analysis

Obfuscated Javascript is not handled gracefully

44

Page 43: Recovering the Behaviour of AJAX Applications

Questions?

45