understanding the redundancy! of software systems
TRANSCRIPT
Understanding the Redundancy!of Software Systems
Andrea Mattavelli
Research Advisor :!Research Co-Advisor :
Prof. Mauro Pezzè!Prof. Antonio Carzaniga
Redundancy
Informally, a system is redundant when!it is able to perform the same functionality !by executing different code.
“
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
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
Modern software systems contain a form of redundancy that is indeed intrinsically present.
“Software RedundancyIntrinsic
Intrinsic Redundancy: ExamplesDateTime t = new DateTime(); //... //get the beginning of the day for time tDateTime beginDay = t.millisOfDay().withMinimumValue();
Joda-Time
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
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();
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();
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%)
Security
Automatic repair
Test oracles
Self-healing
Studying Intrinsic RedundancyUsing
Modern software systems contain a form of redundancy that is indeed intrinsically present.
“Studying Intrinsic RedundancyStudying
What is its essence?Modern software systems contain a form of redundancy that is indeed intrinsically present.
“Studying Intrinsic RedundancyStudying
How pervasive is it?
What is its essence?Modern software systems contain a form of redundancy that is indeed intrinsically present.
“Studying Intrinsic RedundancyStudying
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
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
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
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
What Is Its Essence?
redundancy=
+functional!
equivalenceexecution diversity
What Is Its Essence?
redundancy=
+functional!
equivalenceexecution diversity
What Is Its Essence?
SA
SB
? ? ?
a1 a2 a3
a1 a2 a3
Observational Equivalence![Hennessy et al.]
redundancy=
+functional!
equivalenceexecution diversity
What Is Its Essence?
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)
How Pervasive Is It?
Joda-Time
GraphStream
SWT
How Pervasive Is It?
Joda-Time
4700+!equivalent method sequences
GraphStream
SWT
How Pervasive Is It?
Intrinsic redundancy
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
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
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
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