Automatic Workarounds: Exploiting the Intrinsic Redundancy of - - PowerPoint PPT Presentation

automatic workarounds exploiting the intrinsic redundancy
SMART_READER_LITE
LIVE PREVIEW

Automatic Workarounds: Exploiting the Intrinsic Redundancy of - - PowerPoint PPT Presentation

Automatic Workarounds: Exploiting the Intrinsic Redundancy of Software to Improve Reliability Antonio Carzaniga , Alessandra Gorla, Nicol` o Perino, Mauro Pezz` e Faculty of Informatics University of Lugano Switzerland March 22, 2012 Scope


slide-1
SLIDE 1

Automatic Workarounds: Exploiting the Intrinsic Redundancy

  • f Software

to Improve Reliability

Antonio Carzaniga, Alessandra Gorla, Nicol`

  • Perino, Mauro Pezz`

e

Faculty of Informatics University of Lugano Switzerland

March 22, 2012

slide-2
SLIDE 2

Scope of this work:

reliability = correctness reliability ≈ fault tolerance

“self-healing. . . ”

slide-3
SLIDE 3

reliability ⇒ redundancy

. . . some redundancy is necessary.

slide-4
SLIDE 4

Examples

N-version programming [Avizenis’75] Recovery blocks [Randell’75]

slide-5
SLIDE 5

Examples

N-version programming [Avizenis’75] Recovery blocks [Randell’75] Many forms of specifications

◮ invariants ◮ assertions ◮ pre/post-conditions

slide-6
SLIDE 6

Examples

N-version programming [Avizenis’75] Recovery blocks [Randell’75] Many forms of specifications

◮ invariants ◮ assertions ◮ pre/post-conditions

Data diversity [Ammann&Knight’88] Robust data structures [Taylor et al.’80] “Rejuvenation” [Garg et al.’96] Rx: “bugs as allergies” [Qin et al.’07] Micro-reboots [Candea et al.’03] . . .

slide-7
SLIDE 7

Examples

N-version programming [Avizenis’75] Recovery blocks [Randell’75] Many forms of specifications

◮ invariants ◮ assertions ◮ pre/post-conditions

Data diversity [Ammann&Knight’88] Robust data structures [Taylor et al.’80] “Rejuvenation” [Garg et al.’96] Rx: “bugs as allergies” [Qin et al.’07] Micro-reboots [Candea et al.’03] . . .

deliberate redundancy

slide-8
SLIDE 8

Examples

N-version programming [Avizenis’75] Recovery blocks [Randell’75] Many forms of specifications

◮ invariants ◮ assertions ◮ pre/post-conditions

Data diversity [Ammann&Knight’88] Robust data structures [Taylor et al.’80] “Rejuvenation” [Garg et al.’96] Rx: “bugs as allergies” [Qin et al.’07] Micro-reboots [Candea et al.’03] . . .

deliberate redundancy

expensive

and possibly ineffective!

slide-9
SLIDE 9
slide-10
SLIDE 10

Hypothesis:

Software is intrinsically redundant

slide-11
SLIDE 11

Hypothesis:

Software is intrinsically redundant

. . . and this intrinsic redundancy can be used to deal with faults at runtime.

slide-12
SLIDE 12

Hypothesis:

Software is intrinsically redundant

. . . and this intrinsic redundancy can be used to deal with faults at runtime. at practically no cost

slide-13
SLIDE 13

Prior Plausibility

slide-14
SLIDE 14

Prior Plausibility

Code clones

◮ pervasive even in binaries [Sæbjørnsen et al.:ISSTA’09] ◮ including semantic clones that are syntactically different [Gabel et

al.:ICSE’08,Jiang&Zu:ISSTA’09]

slide-15
SLIDE 15

Prior Plausibility

Code clones

◮ pervasive even in binaries [Sæbjørnsen et al.:ISSTA’09] ◮ including semantic clones that are syntactically different [Gabel et

al.:ICSE’08,Jiang&Zu:ISSTA’09]

Design for reusability

◮ display functions in JQuery: fadeIn(), show(), fadeTo(), animate() ◮ mutually interchangeable methods in Java SWT: setLocation(Point)

and setLocation(int x, int y), setSize(Point) and setSize(int), etc.

◮ alternative operations in Java containers: add(Component comp),

add(Component comp, int index), add(Component comp, Object constraints), add(Component comp, Object constraints, int index), remove(Component comp), remove(int index), removeAll(), etc.

slide-16
SLIDE 16

Prior Plausibility (2)

Performance optimization

◮ in the Apache Ant library StringUtils.endsWith() reimplements

java.lang.String.endsWith(); CollectionUtils.frequency() reimplements java.util.Collection.frequency(), SelectorUtils.tokenizePathAsArray() reimplements tokenizePath(), etc.

◮ the GNU Standard C++ Library has two implementations of stable

sort (insertion-sort used for small sequences, and merge-sort for the general case)

slide-17
SLIDE 17

Prior Plausibility (2)

Performance optimization

◮ in the Apache Ant library StringUtils.endsWith() reimplements

java.lang.String.endsWith(); CollectionUtils.frequency() reimplements java.util.Collection.frequency(), SelectorUtils.tokenizePathAsArray() reimplements tokenizePath(), etc.

◮ the GNU Standard C++ Library has two implementations of stable

sort (insertion-sort used for small sequences, and merge-sort for the general case)

Backward compatibility

◮ 45 classes and 365 methods in the Java 6 standard library are

deprecated, and they duplicate exactly or almost exactly the functionality of newer classes and methods

slide-18
SLIDE 18
slide-19
SLIDE 19

Example: Google Maps Issue n. 1305

polyline.enableDrawing();

slide-20
SLIDE 20

Example: Google Maps Issue n. 1305

v = polyline.deleteVertex(polyline.getVertexCount()-1); polyline.insertVertex(polyline.getVertexCount()-1,v); polyline.enableDrawing();

slide-21
SLIDE 21

Do Workarounds Exist?

slide-22
SLIDE 22

Do Workarounds Exist?

Analysis of issues recorded in issue-tracking systems system reported faults selected “workaround” confirmed workarounds

Google Maps ≈ 400 63 43 YouTube 21 9

10% of reported faults in Google Maps admit to a workaround

◮ conservative estimate

42% of reported faults in YouTube admit to a workaround

slide-23
SLIDE 23

Do Automatic Workarounds Exist?

slide-24
SLIDE 24

Do Automatic Workarounds Exist?

Which workarounds can be plausibly generated automatically? system confirmed workarounds confirmed automatic workarounds

Google Maps 43 14 YouTube 9 5

33% workarounds in Google Maps could be generated automatically 55% of workarounds in YouTube could be generated automatically

slide-25
SLIDE 25

General Idea

application state space

slide-26
SLIDE 26

General Idea

application state space

slide-27
SLIDE 27

General Idea

application state space

slide-28
SLIDE 28

General Idea

application state space

slide-29
SLIDE 29

General Idea

application state space

slide-30
SLIDE 30

General Idea

application state space

slide-31
SLIDE 31

General Idea

application state space

slide-32
SLIDE 32

General Idea

application state space

slide-33
SLIDE 33

General Idea

application state space

slide-34
SLIDE 34

General Idea

application state space

slide-35
SLIDE 35

General Idea

application state space

slide-36
SLIDE 36

General Idea

application state space

slide-37
SLIDE 37

General Idea

application state space failure detection

slide-38
SLIDE 38

General Idea

application state space failure detection checkpoint recovery

slide-39
SLIDE 39

General Idea

application state space failure detection checkpoint recovery workaround

slide-40
SLIDE 40

Web Applications

An initial “easy” context. . .

slide-41
SLIDE 41

Web Applications

An initial “easy” context. . . failure detection: the user can do that for us

slide-42
SLIDE 42

Web Applications

An initial “easy” context. . . failure detection: the user can do that for us checkpoint/recovery: simply reload the page

◮ applications are mostly stateless (on the client-side)

slide-43
SLIDE 43

Web Applications

An initial “easy” context. . . failure detection: the user can do that for us checkpoint/recovery: simply reload the page

◮ applications are mostly stateless (on the client-side)

workarounds: alternative sequences

◮ represented as code-rewriting rules

Example: setTags($X,$Y); − → setTags($X); appendTags($Y);

◮ implemented as a proxy or as a browser extension ◮ priority scheme, automatic oracle, . . . [Carzaniga et al. FSE’10]

slide-44
SLIDE 44

Does It Work?

slide-45
SLIDE 45

Does It Work?

system rewriting rules issues considered known WA unknown WA total

Google Maps 39 14 24 38 YouTube 40 5 1 6 jQuery 68 25 77 102

slide-46
SLIDE 46

Does It Work?

system rewriting rules issues considered known WA unknown WA total

Google Maps 39 14/14 15+9/24 38 YouTube 40 5/5 1/1 6 jQuery 68 25/25 42+35/77 102 (found, not found)

slide-47
SLIDE 47

Does It Work?

system rewriting rules issues considered known WA unknown WA total

Google Maps 39 14/14 15+9/24 38 YouTube 40 5/5 1/1 6 jQuery 68 25/25 42+35/77 102 (found, not found) Google Maps: 76% YouTube: 100% jQuery: 65%

slide-48
SLIDE 48

Does It Work?

system rewriting rules issues considered known WA unknown WA total

Google Maps 39 14/14 15+9/24 38 YouTube 40 5/5 1/1 6 jQuery 68 25/25 42+35/77 102 (found, not found) Google Maps: 76% YouTube: 100% jQuery: 65% max iterations found not found 9 15 8 5 8

slide-49
SLIDE 49

Does It Work?

system rewriting rules issues considered known WA unknown WA total

Google Maps 39 14/14 15+9/24 38 YouTube 40 5/5 1/1 6 jQuery 68 25/25 42+35/77 102 (found, not found) Google Maps: 76% YouTube: 100% jQuery: 65% max iterations w/ oracle found not found 2 3 1 2 2

slide-50
SLIDE 50

Current and Future Work

slide-51
SLIDE 51

Current and Future Work

Supporting general-purpose applications Measuring software’s intrinsic redundancy Approximate redundancy: almost-equivalent sequences Dealing with multi-threaded applications. . .

slide-52
SLIDE 52
slide-53
SLIDE 53

Anything to do with. . .

multiplicity computing?

slide-54
SLIDE 54

Anything to do with. . .

multiplicity computing?

Yes! Use available computing power to improve reliability by exploiting software’s intrinsic redundancy

slide-55
SLIDE 55

right now it’s only a notion but I think I can get money to make it into a concept and later turn it into an idea

[Woody Allen ’77, “Annie Hall”]

exploiting intrinsic redundancy by design extended contracts + infrastructure + runtime analysis

document potential intrinsic redundancy “orchestrate” some development at runtime