understanding the redundancy! of software systems

31
Understanding the Redundancy of Software Systems Andrea Mattavelli Research Advisor: Research Co-Advisor: Prof. Mauro Pezzè Prof. Antonio Carzaniga

Upload: trinhnhu

Post on 30-Dec-2016

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Understanding the Redundancy! of Software Systems

Understanding the Redundancy!of Software Systems

Andrea Mattavelli

Research Advisor :!Research Co-Advisor :

Prof. Mauro Pezzè!Prof. Antonio Carzaniga

Page 2: Understanding the Redundancy! of Software Systems

Redundancy

Informally, a system is redundant when!it is able to perform the same functionality !by executing different code.

Page 3: Understanding the Redundancy! of Software Systems

Software Redundancy

Version 1

Version 2

Version n

Selection!Algorithm

...

Input

Input Checkpoint Execute Version Test

Output

Output

Exception Fail

Restore

Alternatives? FailNo

N-version Recovery Blocks

Yes

Software

Page 4: Understanding the Redundancy! of Software Systems

Software Redundancy

Version 1

Version 2

Version n

Selection!Algorithm

...

Input

Input Checkpoint Execute Version Test

Output

Output

Exception Fail

Restore

Alternatives? FailNo

N-version Recovery Blocks

Yes

Deliberate

Page 5: Understanding the Redundancy! of Software Systems

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Software RedundancyIntrinsic

Page 6: Understanding the Redundancy! of Software Systems

Intrinsic Redundancy: ExamplesDateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue();

Joda-Time

Page 7: Understanding the Redundancy! of Software Systems

DateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue(); = t.toDateMidnight().toDateTime(); = t.withTimeAtStartOfDay();

Joda-Time

Intrinsic Redundancy: Examples

Page 8: Understanding the Redundancy! of Software Systems

Joda-Time

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

Google Guava

Intrinsic Redundancy: ExamplesDateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue(); = t.toDateMidnight().toDateTime(); = t.withTimeAtStartOfDay();

Page 9: Understanding the Redundancy! of Software Systems

Joda-Time

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

Intrinsic Redundancy: ExamplesDateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue(); = t.toDateMidnight().toDateTime(); = t.withTimeAtStartOfDay();

Page 10: Understanding the Redundancy! of Software Systems

Joda-Time

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

Intrinsic Redundancy: ExamplesDateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue(); = t.toDateMidnight().toDateTime(); = t.withTimeAtStartOfDay();

0 LOC!(0%)

2 LOC!(~0.1%)

Page 11: Understanding the Redundancy! of Software Systems

Security

Automatic repair

Test oracles

Self-healing

Studying Intrinsic RedundancyUsing

Page 12: Understanding the Redundancy! of Software Systems

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 13: Understanding the Redundancy! of Software Systems

What is its essence?Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 14: Understanding the Redundancy! of Software Systems

How pervasive is it?

What is its essence?Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 15: Understanding the Redundancy! of Software Systems

How pervasive is it?

What is its essence?

How to identify it?

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 16: Understanding the Redundancy! of Software Systems

Why is it present?How pervasive is it?

What is its essence?

How to identify it?

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 17: Understanding the Redundancy! of Software Systems

Why is it present?How pervasive is it?

What is its essence?

How to identify it?

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 18: Understanding the Redundancy! of Software Systems

Why is it present?How pervasive is it?

What is its essence?

How to identify it?

Modern software systems contain a form of redundancy that is indeed intrinsically present.

“Studying Intrinsic RedundancyStudying

Page 19: Understanding the Redundancy! of Software Systems

What Is Its Essence?

Page 20: Understanding the Redundancy! of Software Systems

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

Page 21: Understanding the Redundancy! of Software Systems

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

SA

SB

? ? ?

a1 a2 a3

a1 a2 a3

Observational Equivalence![Hennessy et al.]

Page 22: Understanding the Redundancy! of Software Systems

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

Page 23: Understanding the Redundancy! of Software Systems

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

com.google.collect.LinkedlistMap.putAll@216com.google.collect.LinkedlistMap.putAll@226com.google.collect.LinkedlistMap.putAll@227com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126!!!

com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126com.google.collect.LinkedlistMap.put@127com.google.collect.LinkedlistMap.put@132com.google.collect.LinkedlistMap.put@133!!

putAll(K key, Iterable values)put(K key, V value)

Page 24: Understanding the Redundancy! of Software Systems

How Pervasive Is It?

Page 25: Understanding the Redundancy! of Software Systems

Joda-Time

GraphStream

SWT

How Pervasive Is It?

Page 26: Understanding the Redundancy! of Software Systems

Joda-Time

4700+!equivalent method sequences

GraphStream

SWT

How Pervasive Is It?

Page 27: Understanding the Redundancy! of Software Systems

Intrinsic redundancy

Page 28: Understanding the Redundancy! of Software Systems

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

SA

SB

? ? ?

a1 a2 a3

a1 a2 a3

com.google.collect.LinkedlistMap.putAll@216com.google.collect.LinkedlistMap.putAll@226com.google.collect.LinkedlistMap.putAll@227com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126!!!

com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126com.google.collect.LinkedlistMap.put@127com.google.collect.LinkedlistMap.put@132com.google.collect.LinkedlistMap.put@133!!

putAll(K key, Iterable values)put(K key, V value)

Intrinsic redundancy

Page 29: Understanding the Redundancy! of Software Systems

How Pervasive Is It?redundancy

=

+functional!

equivalenceexecution diversity

What Is Its Essence?

SA

SB

? ? ?

a1 a2 a3

a1 a2 a3

com.google.collect.LinkedlistMap.putAll@216com.google.collect.LinkedlistMap.putAll@226com.google.collect.LinkedlistMap.putAll@227com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126!!!

com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126com.google.collect.LinkedlistMap.put@127com.google.collect.LinkedlistMap.put@132com.google.collect.LinkedlistMap.put@133!!

putAll(K key, Iterable values)put(K key, V value)

Intrinsic redundancy

Page 30: Understanding the Redundancy! of Software Systems

How Pervasive Is It?

How to Identify It?

pop()

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

Stack s = new Stack();s.push(0);s.push(1);!Stack s = new Stack();s.push(-174);

Execution Scenarios

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

SA

SB

? ? ?

a1 a2 a3

a1 a2 a3

com.google.collect.LinkedlistMap.putAll@216com.google.collect.LinkedlistMap.putAll@226com.google.collect.LinkedlistMap.putAll@227com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126!!!

com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126com.google.collect.LinkedlistMap.put@127com.google.collect.LinkedlistMap.put@132com.google.collect.LinkedlistMap.put@133!!

putAll(K key, Iterable values)put(K key, V value)

Intrinsic redundancy

Page 31: Understanding the Redundancy! of Software Systems

How Pervasive Is It?

How to Identify It?

pop()

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

Stack s = new Stack();s.push(0);s.push(1);!Stack s = new Stack();s.push(-174);

Execution Scenarios

Design for reusability

Non-functional requirements

Replicated Functionalities

Backward compatibility

Why?

redundancy=

+functional!

equivalenceexecution diversity

What Is Its Essence?

SA

SB

? ? ?

a1 a2 a3

a1 a2 a3

com.google.collect.LinkedlistMap.putAll@216com.google.collect.LinkedlistMap.putAll@226com.google.collect.LinkedlistMap.putAll@227com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126!!!

com.google.collect.LinkedlistMap.put@123com.google.collect.LinkedlistMap.put@125com.google.collect.LinkedlistMap.put@126com.google.collect.LinkedlistMap.put@127com.google.collect.LinkedlistMap.put@132com.google.collect.LinkedlistMap.put@133!!

putAll(K key, Iterable values)put(K key, V value)

Intrinsic redundancy