"analyzing spls in minutes instead of years" may 24, 2013 aarhus uni (daimi) statically...
TRANSCRIPT
![Page 1: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/1.jpg)
"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Statically AnalyzingSoftware Product Lines
in Minutes instead of YearsSPLLIFT
Eric BoddenTechnische Universität Darmstadt
Társis TolêdoUniversidade Federal de Pernambuco
Márcio RibeiroUniversidade Federal de Alagoas[ [email protected] ]
Mira MeziniTechnische Universität Darmstadt[ [email protected]]
Claus BrabrandIT University of Copenhagen[ [email protected] ]
Paulo BorbaUniversidade Federal de Pernambuco
- PLDI 2013 -
![Page 2: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/2.jpg)
"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
IntraproceduralDataflow Analysis for
Software Product LinesDFA-4-SPLClaus Brabrand
IT University of CopenhagenUniversidade Federal de Pernambuco
Márcio RibeiroUniversidade Federal de Alagoas
Universidade Federal de Pernambuco[ [email protected] ]
Paulo BorbaUniversidade Federal de Pernambuco
Társis ToledoUniversidade Federal de Pernambuco
- AOSD 2012 -
![Page 3: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/3.jpg)
"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
IntraproceduralDataflow Analysis for
Software Product Lines
- TAOSD 2013 -
Társis TolêdoUniversidade Federal de Pernambuco
Márcio RibeiroUniversidade Federal de Alagoas[ [email protected] ]
Paulo BorbaUniversidade Federal de Pernambuco
Claus BrabrandIT University of Copenhagen[ [email protected] ]
Johnni WinterAarhus University
![Page 4: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/4.jpg)
[ 5 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Outline >
Introduction:Dataflow Analysis and Software Product Lines
DFA-4-SPL:A0 (brute force): (feature in-sensitive)
A1 (consecutive): (feature sensitive)
A2 (simultaneous): (feature sensitive)
A3 (shared simultaneous): (feature sensitive)
Evaluation and ResultsSPLLIFT (graph encoding):
Related Work
Conclusion
![Page 5: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/5.jpg)
[ 6 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Introduction
1x CAR
=
1x CELL PHONE
=
1x APPLICATION
=
CARS CELL PHONES APPLICATIONS
Traditional Software Development:One program = One product
Product Line:A ”family” of products (of N ”similar” products):
customize
SPL:(Family ofPrograms)
![Page 6: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/6.jpg)
[ 7 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Software Product Line
SPLs based on Conditional Compilation:
#ifdef ( )
...
#endif
Logo logo;...
...logo.use();
#ifdef (VIDEO) logo = new Logo();#endif
Exam
ple
(SPL
fragm
ent)
: fF | |
![Page 7: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/7.jpg)
[ 8 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Software Product Line
SPL:
Feature Model: (e.g.: ψFM ≡ VIDEO COLOR)
Family ofPrograms:
COLOR
VIDEO
COLORVIDEO
VID
EO
Ø
{ Video }
{ Color, Video }
Configurations:Ø, {Color}, {Video}, {Color,Video}VALID
{ Color }
customize
2F
Set of Features:F = { COLOR, VIDEO }
2F
![Page 8: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/8.jpg)
[ 9 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Software Product Line
SPLs based on Conditional Compilation:
#ifdef ( )
...
#endif
Logo logo;...
...logo.use();
#ifdef (VIDEO) logo = new Logo();#endif
Exam
ple
(SPL
fragm
ent) *** null-pointer exception!
in configurations: {Ø, {COLOR}}
: fF | |
![Page 9: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/9.jpg)
[ 10 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
resultresult
0100101111011010100111110111
0100101111011010100111110111
Analysis of SPLs
The Compilation Process:
...and for Software Product Lines:
0100101111011010100111110111
resultcompile run
ERROR!
generate 0100101111011010100111110111
result
run
ERROR!
ANALYZE!
ANALYZE!
Feature-sensitive data-flow analysis !
runruncompilecompilecompile
ANALYZE!ANALYZE! ERROR!ERROR!
2F
![Page 10: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/10.jpg)
[ 11 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Dataflow Analysis
Dataflow Analysis:1) Control-flow graph
2) Lattice (finite height)
3) Transfer functions (monotone)
L
Example:"sign-of-x analysis"
![Page 11: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/11.jpg)
[ 12 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Analyzing a Program1) Program 2) Build CFG 3) Make Equations
4) Solve equations: fixed-point computation (iteration)
5) SOLUTION (least fixed point):
Annotated with program points
![Page 12: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/12.jpg)
[ 13 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Outline >
Introduction:Dataflow Analysis and Software Product Lines
DFA-4-SPL:A0 (brute force): (feature in-sensitive)
A1 (consecutive): (feature sensitive)
A2 (simultaneous): (feature sensitive)
A3 (shared simultaneous): (feature sensitive)
Evaluation and ResultsSPLLIFT (graph encoding):
Related Work
Conclusion
![Page 13: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/13.jpg)
[ 14 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
A0
A0 (brute force):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}
c = {A}: c = {B}: c = {A,B}:
int x = 0;
x++;
x--;
int x = 0;
x++;
x--;
int x = 0;
x++;
x--;
0
_|
+
0
_|
-
0
_|
0/+
+
ψFM = A B∨
Lfeature in-sensitive!
N = O(2F) compilations!
![Page 14: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/14.jpg)
[ 15 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
int x = 0;
x++;
x--;
A:
B:
int x = 0;
x++;
x--;
A:
B:
int x = 0;
x++;
x--;
A:
B:
A1
A1 (consecutive):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}
c = {A}:
0
_|
+
✗
✓
✓
ψFM = A B∨
L
c = {B}: c = {A,B}:
0
_|
-
0
_|
0/+
+
✗
✓ ✓
✓
✓ ✓
+
0
feature sensitive!
![Page 15: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/15.jpg)
[ 16 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
x++;
+({A} = , {B} = , {A,B} = )
({A} = , {B} = , {A,B} = )
({A} = , {B} = , {A,B} = )
A2
A2 (simultaneous):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}
∀c ∈ {{A},{B},{A,B}}:
int x = 0;
x--;
0
_|
0
_|
-
0
_|
0/+
+
A:
B:
✓({A} = , {B} = , {A,B} = )
✓✓
✓✓
✓✓
✗
✗
ψFM = A B∨
L
0
+
feature sensitive!
![Page 16: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/16.jpg)
[ 17 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
x--;
+
x++;
0
( [[ψ ¬A ]] = , [[∧ ψ A ]] = , [[∧ ψ ¬A ]] = , [[∧ ψ A ]] = )∧
( [[ψ ]] = , [[ψ ]] = )
A3
A3 (shared):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}
ψFM = A B:∨
int x = 0;
A:
B:
_|( [[ψ]] = )
0( [[ψ]] = )
(A B) ¬A ¬B ≡ ∨ ∧ ∧ false
can use BDDrepresentation !(compact+efficient)
- 0/+
i.e., invalid given wrt.the feature model, ψ !
ψFM = A B∨
L
0∧¬A ∧A +
∧¬B ∧¬B ∧B ∧B
feature sensitive!
![Page 17: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/17.jpg)
[ 18 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Outline >
Introduction:Dataflow Analysis and Software Product Lines
DFA-4-SPL:A0 (brute force): (feature in-sensitive)
A1 (consecutive): (feature sensitive)
A2 (simultaneous): (feature sensitive)
A3 (shared simultaneous): (feature sensitive)
Evaluation and ResultsSPLLIFT (graph encoding):
Related Work
Conclusion
![Page 18: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/18.jpg)
[ 19 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Evaluation
Five (qualitatively different) SPL benchmarks:
![Page 19: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/19.jpg)
[ 20 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Results (intra)
In practice:
4x
(Reaching Definitions)(Total time, incl. compile)
7x
3x
1x
1x
(no re-compile!)
Feature sensitive(A1, A2, and A3)all faster than A0
![Page 20: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/20.jpg)
[ 21 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Overview
A0 (brute force)
A1 (consecutive)
A2 (simultaneous)
A3 (shared)
A* (combo)
FASTER
(intra-procedural)
no re-compile!
caching!
sharing!
combo!
AOSD2012
TAOSD 2013
![Page 21: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/21.jpg)
[ 22 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Beyond the Sum of all Methods
For a method with K valid configurations, which of analyses A1 vs A2 vs A3 is fastest?
Statistically significant differences between A1, A2, and A3 for all N,except between A2 and A3 for N=4 (underlined above).
K #
![Page 22: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/22.jpg)
[ 23 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Combo Analysis Strategy: A*
Intraprocedurally combinedanalysis strategy, A*:
A* consistently fastest(combo!)
![Page 23: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/23.jpg)
[ 24 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Overview (cont'd)
A0 (brute force)
A1 (consecutive)
A2 (simultaneous)
A3 (shared)
A* (combo)
SPLLIFT
FASTER
(intra-procedural)
PLDI 2013
IFDS (graph repr)
A3+BDD (esp. inter- procedural)
no re-compile!
caching!
sharing!
combo!
graphencoding!
repr!
AOSD2012
TAOSD 2013
![Page 24: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/24.jpg)
[ 25 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
true
[ (A B)∧ ¬A∧ ] ∨ [ true A∧ ]
= A
true A B∧
true ¬A∧ = ¬A
true
SPLLIFT
IFDS:A0:
λS . (S – {x}) {y}∪
{x}
{y}
SPLLIFT:A2:
( {A} = {x} , {B} = {x} , {A,B} = {x,y} )
0 x y
0 x y
0 x y
0 x y
λS . (S – {x}) {y}∪A:
#ifdef (A)
( {A} = {y} , {B} = {x} , {A,B} = {y} )
A ¬A¬A
LIFT:
■ Reps■ Horwitz■ Sagiv
fixed-pointiteration
graphreachability➔
¬A A
![Page 25: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/25.jpg)
[ 26 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Example SPL
config = {G}(¬F G ¬H)∧ ∧
customize(instantiate)(preprocess)
Software Product Line: Conventional Program:
![Page 26: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/26.jpg)
[ 27 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Exploded Super Graph...for Program:
![Page 27: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/27.jpg)
[ 28 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Lifted Exploded Super Graph...for SPL:
![Page 28: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/28.jpg)
[ 29 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Results (inter)
Results for SPLLIFT (interprocedural analysis):
In fact, analyzing all valid configurations is only slightly slower than analyzing one configuration !
Conclusion:Analyze SPLs in Minutes instead of Years!
Reaching Definitions Possible Types Uninitialized Vars
SPL |F| # validconfigs
A1 SPLLIFT A1 SPLLIFT A1 SPLLIFT
Lampiro 2 4 3m30s 42s 13s 4s 3m09s 1m25s
MM 08 9 26 24m29s 59s 2m06s 3s 27m39s 2m13s
GPL 19 1,872 days 8m48s 9h03m39s 42s days 7m09s
BerkeleyDB 39 unknown
years 12m04s years 24s years 10m18s
![Page 29: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/29.jpg)
[ 30 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Outline >
Introduction:Dataflow Analysis and Software Product Lines
DFA-4-SPL:A0 (brute force): (feature in-sensitive)
A1 (consecutive): (feature sensitive)
A2 (simultaneous): (feature sensitive)
A3 (shared simultaneous): (feature sensitive)
Evaluation and ResultsSPLLIFT (graph encoding):
Related Work
Conclusion
![Page 30: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/30.jpg)
[ 31 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Related Work (DFA)
Path-sensitive DFA:
Idea of “conditionally executed statements”
Compute different analysis info along different paths (~ A1, A2, A3) to improve precision or to optimize “hot paths”
Predicated DFA:
Guard lattice values by propositional logic predicates (~ A3), yielding “optimistic dataflow values” that are kept distinct during analysis (~ A2 and A3)
“Constant Propagation with Conditional Branches”( Wegman and Zadeck ) TOPLAS 1991
“Predicated Array Data-Flow Analysis for Run-time Parallelization”( Moon, Hall, and Murphy ) ICS 1998
Our work: Automatically lift any DFA to SPLs (with ψFM) ⇒feature-sensitive analysis for analyzing entire program family
![Page 31: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/31.jpg)
[ 32 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Related Work (Lifting for SPLs)
Model Checking:
Type Checking:
Parsing:
Testing:
Model Checking Lots of Systems: Efficient Verification of Temporal Properties in Software Product Lines”( Classen, Heymans, Schobbens, Legay, and Raskin ) ICSE 2010
Model checks all SPLs at the same time (3.5x faster) than one by one! (similar goal, diff techniques)
Type checking ↔ DFA (similar goal, diff techniques)Our: auto lift any DFA (uninit vars, null pointers, ...)
“Type Safety for Feature-Oriented Product Lines”( Apel, Kastner, Grösslinger, and Lengauer ) ASE 2010
“Type-Checking Software Product Lines - A Formal Approach”( Kastner and Apel ) ASE 2008
“Variability-Aware Parsing in the Presence of Lexical Macros & C.C.”( Kastner, Giarrusso, Rendel, Erdweg, Ostermann, and Berger ) OOPSLA 2011
“Reducing Combinatorics in Testing Product Lines”( Hwan, Kim, Batory, and Khurshid ) AOSD 2011
Select relevant feature combinations for a given test caseUses (hardwired) DFA (w/o FM) to compute reachability
(similar techniques, diff goal):Split and merging parsing (~A3) and also uses instrumentation
![Page 32: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/32.jpg)
[ 33 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Emerging Interfaces
![Page 33: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/33.jpg)
[ 34 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Emerging Interfaces
"A Tool for Improving Maintainability of Preprocessor-based Product Lines"( Márcio Ribeiro, Társis Tolêdo, Paulo Borba, Claus Brabrand )
*** Best Tool Award ***CBSoft 2011:
![Page 34: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/34.jpg)
[ 35 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Outline >
Introduction:Dataflow Analysis and Software Product Lines
DFA-4-SPL:A0 (brute force): (feature in-sensitive)
A1 (consecutive): (feature sensitive)
A2 (simultaneous): (feature sensitive)
A3 (shared simultaneous): (feature sensitive)SPLLIFT (graph encoding):
Evaluation and Results
Related Work
Conclusion
![Page 35: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/35.jpg)
[ 36 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Conclusion
Statically Analyze SPLs in Minutes instead of Years
Scalable!
![Page 36: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/36.jpg)
"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
< Obrigado* >
*) Thanks
![Page 37: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/37.jpg)
"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
BONUS SLIDES
![Page 38: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/38.jpg)
[ 39 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
ErrorsLogo logo;
logo.use();
#ifdef (VIDEO) logo = new Logo();#endif
*** null-pointer exception!in configurations: {Ø, {COLOR}}
Logo logo;
print(logo);
#ifdef (VIDEO) logo = new Logo();#endif
*** uninitialized variable!in configurations: {Ø, {COLOR}}
Logo logo;
...
#ifdef (VIDEO) logo = new Logo();#endif
*** unused variable!in configurations: {Ø, {COLOR}}
![Page 39: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/39.jpg)
[ 40 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Summary
A0 A1
A2
A3
void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}
Analyzing program:
ψFM = A B∨
![Page 40: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/40.jpg)
[ 41 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Specification: A0, A1, A2, A3
A0
A1
A2
A3
![Page 41: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/41.jpg)
[ 42 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Analysis Time (excl. compile)
In practice: (caching!)(Reaching Definitions)
A2 faster than A1
A3 faster than A2(sharing!)
![Page 42: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/42.jpg)
[ 43 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Analysis Time (excl. compile)
In theory:
In practice: TIME(A3) : Depends ondegree of sharing in SPL !
(caching!)
(Reaching Definitions) A2 faster than A1
A3 faster than A2(sharing!)
![Page 43: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/43.jpg)
[ 44 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Memory Usage
In theory:
In practice:(Reaching Definitions)
SPACE(A3) : Depends ondegree of sharing in SPL !
![Page 44: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/44.jpg)
[ 45 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Analysis Time (excl. compile)
In practice:(Reaching Definitions)
Nx1 ≠ 1xN ?!
Caching!A2 faster than A1
![Page 45: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/45.jpg)
[ 46 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Caching (A1 vs A2)
Cache misses (A1 vs A2):
Cache enabled:This is the "normal condition" (for reference)
Cache disabled*:As hypothesized, this indeed affects A1 more than A2
i.e., A2 has better cache properties than A1
*) we flush the L2 cache, by traversing an 8MB “bogus array” to invalidate cache!
![Page 46: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/46.jpg)
[ 47 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
IFDEF normalization
Refactor "undisciplined" (lexical) ifdefs into "disciplined" (syntactic) ifdefs:
Normalize "ifdef"s (by transformation):
![Page 47: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/47.jpg)
[ 48 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Lexical #ifdef Syntactic ifdef
Simple transformation:
We do not handle non-syntactic '#ifdef's:
Fair assumption(also in CIDE)
Nested ifdef's also give rise to a conj.of formulas
![Page 48: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/48.jpg)
[ 49 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
BDD (Binary Decision Diagram)
Compact and efficient representation forboolean functions (aka., set of set of names)
FAST: negation, conjunction, disjunction, equality !
= F(A,B,C) = A(BC)
A
C
minimized BDD
B
A
BB
C C C C
BDD
![Page 49: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/49.jpg)
[ 50 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Formula ~ Set of Configurations
Definitions (given F, set of feature names):f F feature namec 2F configuration (set of feature names) c FX 22 set of config's (set of set of feature names) X 2F
Exampleifdefs:
F
[[ BA ]]
[[ A(BC) ]]
F = {A,B}
F = {A,B,C}
= { {A}, {B}, {A,B} }
= { {A,B}, {A,C}, {A,B,C} }
![Page 50: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/50.jpg)
[ 51 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Feature Model (Example)
Feature Model:
Feature set:
Formula:
Set of configurations:FM Car Engine (1.01.4) Air1.4
{ {Car, Engine, 1.0}, {Car, Engine, 1.4}, {Car, Engine, 1.4, Air} }
F = {Car, Engine, 1.0, 1.4, Air}
Note:| [[FM]] | = 3 < 32 = |2F |
[[ ]] =
Engine
1.0
Air
Air
1.4
![Page 51: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/51.jpg)
[ 52 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
Conditional Compilation
The 'ifdef' construction:
Syntactic variant of lexical #ifdef
Propositional Logic:
where fF (finite set of feature names)
Example:
STM : 'ifdef' '(' ')' STM
: fF | |
status.print("you die");ifdef (DeluxeVersion && ColorDisplay) { player.redraw(Color.red); Audio.play("crash.wav");}lives = lives - 1;
A
ifdef (A) { ...
}
![Page 52: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/52.jpg)
[ 53 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
CASE 1: "COPY"
A3: Lazy Splitting (using BDDs)CASE 2: "APPLY" CASE 3: "SPLIT"
: S
[ =l , ... ]
[ =l , ... ]
l ' = fS(l )
: S
[ =l , ... ]
[ =l ', ... ]
l ' = fS(l )
: S
[ =l , ... ]
[ =l, =l' ,...]
l ' = fS(l )
= Ø = Ø
![Page 53: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/53.jpg)
[ 54 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
A0, A1, A2, and A3A0 A1
A2 A3
![Page 54: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/54.jpg)
[ 55 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
IFDS Graph Encoding
IFDS Transfer Functions:"Graph encoding":
![Page 55: "Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL](https://reader035.vdocuments.mx/reader035/viewer/2022062717/56649e255503460f94b14cc6/html5/thumbnails/55.jpg)
[ 56 ]"Analyzing SPLs in Minutes instead of Years" May 24, 2013Aarhus Uni (DAIMI)
SPLLIFT Transfer Functions