intrinsic software redundancy · cross-checking oracles from intrinsic software redundancy [icse...

44
Intrinsic Software Redundancy for Self-Healing Software Systems and Automated Oracle Generation Alessandra Gorla IMDEA Software Institute - Spain Paolo Tonella Fondazione Bruno Kessler - Italy Antonio Carzaniga, Alberto Goffi, Andrea Mattavelli, Nicolò Perino, Mauro Pezzè Università della Svizzera italiana (USI) - Switzerland

Upload: others

Post on 21-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancyfor Self-Healing Software Systems and Automated Oracle Generation

Alessandra GorlaIMDEA Software Institute - Spain

Paolo TonellaFondazione Bruno Kessler - Italy

Antonio Carzaniga, Alberto Goffi, Andrea Mattavelli, Nicolò Perino, Mauro Pezzè

Università della Svizzera italiana (USI) - Switzerland

Page 2: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

A system is redundant when it is able to perform equivalent functionalities by executing different code.“

Software Redundancy

Page 3: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

“ lead to same states

compute same results

Software Redundancy

A system is redundant when it is able to perform equivalent functionalities by executing different code.

Page 4: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancy

Page 5: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancy

MultiMap m = new MultiMap();//…//check if element is already in mapif (m.contains(x))

Google Guava

Page 6: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancy

MultiMap m = new MultiMap();//…//check if element is already in mapif (m.contains(x)) if (m.elementSet().contains(x)) if (m.count(x) > 0)

Google Guava

Page 7: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

MultiMap m = new MultiMap();//…//check if element is already in mapif (m.contains(x)) if (m.elementSet().contains(x)) if (m.count(x) > 0)

0 LOC

Intrinsic Software Redundancy

Google Guava

Page 8: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Joda-Time

4700equivalences

GraphStream

SWT

Intrinsic Software Redundancy

+

Page 9: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Exploiting the Intrinsic Redundancy of Software

Page 10: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 11: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 12: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Fault

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 13: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Failure detection

Fault

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 14: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Failure detection

Checkpoint /Restore

Fault

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 15: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Fault

Failure detection

Checkpoint /Restore

Redundancy for Self-Healing

Workaround

Automatic Recovery from Runtime Failures [ICSE 2013]

Page 16: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Application state space

A

B

Fault

Failure detection

Checkpoint /Restore

Redundancy for Self-Healing

Equivalentintended behavior

Differentactual execution

Workaround

Automatic Recovery from Runtime Failures [ICSE 2013]

Page 17: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

JodaTimeGuava

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 18: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

JodaTime

Mutants

Guava

Carrot2Caliper Closure compiler

Redundancy for Self-Healing

347

87

50

148

Automatic Recovery from Runtime Failures [ICSE 2013]

FB2PDF

Page 19: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

JodaTime

Mutants 347

67Successfullyrecovered

FB2PDF

Guava

Carrot2Caliper Closure compiler

87

24

50

24

148

6427% 48% 43% 19%

Redundancy for Self-HealingAutomatic Recovery from Runtime Failures [ICSE 2013]

Page 20: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 21: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test() { … put(k,v); …}

test()

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 22: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test() { … put(k,v); …}

test()

put

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 23: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test() { … put(k,v); …}

put ≡ putAlltest()

put

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 24: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test()

putAll

test() { … put(k,v); …}

put

put ≡ putAll

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 25: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test()

putAllput

put ≡ putAlltest() { … put(k,v); …}

≡?

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 26: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

test()

putAllput

≡?

Cross-Checking Oracle

test() { … put(k,v); …}

put ≡ putAll

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 27: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Cross-Checking vs Implicit OraclesM

utat

ion

Scor

e

0%

20%

40%

60%

80%

100%

Implicit oracles Both Cross-checking oracles

Google Guava Joda-Time GraphStream

Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 28: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Cross-Checking vs Developers’ OraclesM

utat

ion

Scor

e

0%

20%

40%

60%

80%

100%

Developers Both Cross-checking oracles

Google Guava Joda-Time GraphStream

Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 29: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Mut

atio

n Sc

ore

0%

20%

40%

60%

80%

100%

Developers Both Cross-checking oracles

Cross-Checking vs Developers’ Oracles

Google Guava Joda-Time GraphStream

Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Page 30: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancy

test()

putAllput

≡?

Cross-Checking Oracle

test() { … put(k,v); …}

put ≡ putAll

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Application state space

A

B

Fault

Failure detection

Checkpoint /Restore

Redundancy for Self-Healing

Workaround

Automatic Recovery from Runtime Failures [ICSE 2013]

Page 31: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Intrinsic Software Redundancy

test()

putAllput

≡?

Cross-Checking Oracle

test() { … put(k,v); …}

put ≡ putAll

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Application state space

A

B

Fault

Failure detection

Checkpoint /Restore

Redundancy for Self-Healing

Workaround

Automatic Recovery from Runtime Failures [ICSE 2013]

Main cost: manual identification of equivalences

Page 32: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Automatic Synthesis of EquivalencesSearch-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 33: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

pop()

int el = s.peek();int index = s.size();index = index - 1;s.remove(index);return el;

Automatic Synthesis of EquivalencesSearch-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 34: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

pop()

int el = s.peek();int index = s.size();index = index - 1;s.remove(index);return el;

Automatic Synthesis of Equivalences

TestsStack s = new Stack();s.push(1);s.push(1);Object ret = s.pop();

Stack s = new Stack();s.push(-4);Object ret = s.pop();

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 35: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

pop()

Search-based

Automatic Synthesis of Equivalences

Search-based

int el = s.peek();int index = s.size();index = index - 1;s.remove(index);return el;

Stack s = new Stack();s.push(1);s.push(1);Object ret = s.pop();

Stack s = new Stack();s.push(-4);Object ret = s.pop();

Tests

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 36: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

pop()

Search-based

Automatic Synthesis of Equivalences

Search-based

int el = s.peek();int index = s.size();index = index - 1;s.remove(index);return el;Counterexample

Stack s = new Stack();s.push(1);s.push(1);Object ret = s.pop();

Stack s = new Stack();s.push(-4);Object ret = s.pop();

Tests

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 37: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

90.5%

Automatic Synthesis of Equivalences

Automatic

Manual

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 38: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

Automatic Synthesis of Equivalences

90.5%

Automatic

Manual

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

Page 39: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

A system is redundant when it is able to perform equivalent functionalities by executing different code.“

Software Redundancy

Page 40: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

“Software Redundancy

How to measure?

A system is redundant when it is able to perform equivalent functionalities by executing different code.

What?

Page 41: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

“Software Redundancy

How to measure?

A system is redundant when it is able to perform equivalent functionalities by executing different code.

What? When?

Page 42: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

“Software Redundancy

REDUNDANCY = f ( , )

A system is redundant when it is able to perform equivalent functionalities by executing different code.

How to measure?

Page 43: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

MeasuringSoftware Redundancy

@ ICSE 2015May 20th, Analysis I

Page 44: Intrinsic Software Redundancy · Cross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014] Application state space A B Fault Failure detection Checkpoint / Restore Redundancy

pop()

Search-based

Automatic Synthesis of Equivalences

Search-based

int el = s.peek();int index = s.size();index = index - 1;s.remove(index);return el;Counterexample

Stack s = new Stack();s.push(1);s.push(1);Object ret = s.pop();

Stack s = new Stack();s.push(-4);Object ret = s.pop();

Tests

Search-Based Synthesis of Equivalent Method Sequences [FSE 2014]

test()

putAllput

≡?

Cross-Checking Oracle

test() { … put(k,v); …}

put ≡ putAll

Redundancy as Test OracleCross-Checking Oracles from Intrinsic Software Redundancy [ICSE 2014]

Application state space

A

B

Fault

Failure detection

Checkpoint /Restore

Redundancy for Self-Healing

Workaround

Automatic Recovery from Runtime Failures [ICSE 2013]

Joda-Time

4700equivalences

GraphStream

SWT

Intrinsic Software Redundancy

+

star.inf.usi.ch