Dataflow Analysis for Software Product Lines May, 2013 SSS Dataflow Analysis for Software Product Lines DFA-4-SPL Claus Brabrand IT University of Copenhagen.

Slides:



Advertisements
Similar presentations
Dataflow Analysis for Datarace-Free Programs (ESOP 11) Arnab De Joint work with Deepak DSouza and Rupesh Nasre Indian Institute of Science, Bangalore.
Advertisements

Precise Interprocedural Analysis using Random Interpretation Sumit Gulwani George Necula UC-Berkeley.
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Intraprocedural Dataflow Analysis for Software Product Lines Claus Brabrand Márcio Ribeiro Társis Tolêdo Paulo Borba.
Claus Brabrand, UFPE, Brazil Aug 11, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
SSA and CPS CS153: Compilers Greg Morrisett. Monadic Form vs CFGs Consider CFG available exp. analysis: statement gen's kill's x:=v 1 p v 2 x:=v 1 p v.
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
Intraprocedural Dataflow Analysis for Software Product Lines
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Course Outline Traditional Static Program Analysis –Theory Compiler Optimizations; Control Flow Graphs Data-flow Analysis – today’s class –Classic analyses.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
Bebop: A Symbolic Model Checker for Boolean Programs Thomas Ball Sriram K. Rajamani
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
Semi-Sparse Flow-Sensitive Pointer Analysis Ben Hardekopf Calvin Lin The University of Texas at Austin POPL ’09 Simplified by Eric Villasenor.
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Program analysis Mooly Sagiv html://
Control Flow Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Program analysis Mooly Sagiv html://
1 Control Flow Analysis Mooly Sagiv Tel Aviv University Textbook Chapter 3
Validating High-Level Synthesis Sudipta Kundu, Sorin Lerner, Rajesh Gupta Department of Computer Science and Engineering, University of California, San.
Data Flow Analysis Compiler Design October 5, 2004 These slides live on the Web. I obtained them from Jeff Foster and he said that he obtained.
1 Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program Analysis.
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
ESP [Das et al PLDI 2002] Interface usage rules in documentation –Order of operations, data access –Resource management –Incomplete, wordy, not checked.
Overview of program analysis Mooly Sagiv html://
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Overview of program analysis Mooly Sagiv html://
Composing Dataflow Analyses and Transformations Sorin Lerner (University of Washington) David Grove (IBM T.J. Watson) Craig Chambers (University of Washington)
Claus Brabrand, UFPE, Brazil Aug 09, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
S.P.L.O.T. - Software Product Lines Online Tools ( Marcilio Mendonca, Moises Branco, Donald Cowan, University of Waterloo, Canada.
Dataflow Analysis for Software Product Lines Feb, 2013 DAGSTUHL Intraprocedural Dataflow Analysis for Software Product Lines Claus Brabrand IT University.
Precision Going back to constant prop, in what cases would we lose precision?
Static Analysis of Software Product Lines Jan Midtgaard Andrzej Wąsowski Claus Brabrand Paulo Borba Mira MeziniEric Bodden Márcio RibeiroTársis Tolêdo.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
"Analyzing SPLs in Minutes instead of Years" May 24, 2013 Aarhus Uni (DAIMI) Statically Analyzing Software Product Lines in Minutes instead of Years SPL.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
PRESTO Research Group, Ohio State University Interprocedural Dataflow Analysis in the Presence of Large Libraries Atanas (Nasko) Rountev Scott Kagan Ohio.
Precise Interprocedural Dataflow Analysis via Graph Reachibility
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Control Flow Resolution in Dynamic Language Author: Štěpán Šindelář Supervisor: Filip Zavoral, Ph.D.
"Derivation of Variability-Aware Program Analyses" May, 2015 FOSD 2015 Claus BRABRAND Jan MIDTGAARD Andrzej WASOWSKI Systematic Derivation of ✔ Variability-Aware.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
VARIETE workshop, ITUVariational Abstract Interpretation Nov 28, 2013 Claus Brabrand IT University of Copenhagen Jan Midtgaard Aarhus Universtity Andrzej.
Efficient Synthesis of Feature Models Article Review By: Sigal Berkovitz & Yohai Vidergor.
Dataflow Analysis for Software Product Lines May 24, 2012 COPLAS, DIKU Dataflow Analysis for Software Product Lines Claus Brabrand IT University of Copenhagen.
CBSE'051 Component-Level Dataflow Analysis Atanas (Nasko) Rountev Ohio State University.
Reducing Combinatorics in Testing Product Lines Chang Hwan Peter Kim, Don Batory, and Sarfraz Khurshid University of Texas at Austin.
1 Control Flow Analysis Topic today Representation and Analysis Paper (Sections 1, 2) For next class: Read Representation and Analysis Paper (Section 3)
1 Iterative Program Analysis Mooly Sagiv Tel Aviv University Textbook: Principles of Program.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Data Flow Analysis Suman Jana
Software Testing.
Systematic Derivation of ✔ Variability-Aware Program Analyses
Introduction to the C Language
University Of Virginia
Binary Decision Diagrams
Data Flow Analysis Compiler Design
Presentation transcript:

Dataflow Analysis for Software Product Lines May, 2013 SSS Dataflow Analysis for Software Product Lines DFA-4-SPL Claus Brabrand IT University of Copenhagen Universidade Federal de Pernambuco [ ] Márcio Ribeiro Universidade Federal de Alagoas Universidade Federal de Pernambuco [ ] Paulo Borba Universidade Federal de Pernambuco [ ] Társis Toledo Universidade Federal de Pernambuco [ ] AOSD 2012 and TAOSD 2013

Dataflow Analysis for Software Product Lines May, 2013 SSS Statically Analyzing Software Product Lines in Minutes instead of Years SPL LIFT Eric Bodden Technische Universität Darmstadt [ ] Társis Tolêdo Universidade Federal de Pernambuco [ ] Márcio Ribeiro Universidade Federal de Alagoas [ ] Mira Mezini Technische Universität Darmstadt [ ] Claus Brabrand IT University of Copenhagen [ ] Paulo Borba Universidade Federal de Pernambuco [ ] PLDI 2013

[ 3 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Abstract Software product lines (SPLs) developed using annotative approaches such as conditional compilation come with an inherent risk of constructing erroneous products. For this reason, it is essential to be able to analyze such SPLs. However, as dataflow analysis techniques are not able to deal with SPLs, developers must generate and analyze all valid products individually, which is expensive for non-trivial SPLs. In this paper, we demonstrate how to take any standard intraprocedural dataflow analysis and automatically turn it into a feature-sensitive dataflow analysis in five different ways where the last is a combination of the other four. All analyses are capable of analyzing all valid products of an SPL without having to generate all of them explicitly. We have implemented all analyses using SOOT’s intraprocedural dataflow analysis framework and experimentally evaluated four of them according to their performance and memory characteristics on five qualitatively different SPLs. On our benchmarks, the combined analysis strategy is up to almost eight times faster than the brute-force approach.

[ 4 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Introduction: Software Product Lines (SPL) Dataflow Analysis (DFA) DFA-4-SPL: A0 (brute force): (feature in-sensitive) A1 (consecutive): (feature sensitive) A2 (simultaneous): (feature sensitive) A3 (shared simultaneous): (feature sensitive) SPL LIFT (graph encoding): Evaluation and Results: A1 vs SPL LIFT

[ 5 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Introduction Traditional Software Development: One program = One product Product Line: A ”family” of products (of N ”similar” products): customize SPL: (Family of Programs)

[ 6 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Software Product Line SPLs based on Conditional Compilation: #ifdef (  )... #endif Logo logo;... logo.use(); #ifdef (VIDEO) logo = new Logo(); #endif Example (SPL fragment)  : f  F |  | 

[ 7 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Software Product Line SPL: Feature Model: (e.g.: ψ FM ≡ VIDEO  COLOR ) Family of Programs: COLOR VIDEO COLOR  VIDEO VIDEO Ø { Video } { Color, Video } Configurations: Ø, {Color}, {Video}, {Color,Video} VALID { Color } customize 2F2F Set of Features: F = { COLOR, VIDEO } 2F2F

[ 8 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Software Product Line SPLs based on Conditional Compilation: #ifdef (  )... #endif Logo logo;... logo.use(); #ifdef (VIDEO) logo = new Logo(); #endif Example (SPL fragment) *** null-pointer exception! in configurations: {Ø, {COLOR}}  : f  F |  | 

[ 9 ] Dataflow Analysis for Software Product Lines May, 2013 SSS result Analysis of SPLs The Compilation Process:...and for Software Product Lines: result compile run ERROR! generate result run ERROR! ANALYZE! Feature-sensitive data-flow analysis ! run compile ANALYZE! ERROR! 2F2F

[ 10 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Dataflow Analysis Dataflow Analysis: 1) Control-flow graph 2) Lattice (finite height) 3) Transfer functions (monotone) L Example: "sign-of-x analysis"

[ 11 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Analyzing a Program 1) Program 2) Build CFG 3) Make Equations 4) Solve equations: fixed-point computation (iteration) 5) SOLUTION (least fixed point): Annotated with program points

[ 12 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Introduction: Software Product Lines (SPL) Dataflow Analysis (DFA) DFA-4-SPL: A0 (brute force): (feature in-sensitive) A1 (consecutive): (feature sensitive) A2 (simultaneous): (feature sensitive) A3 (shared simultaneous): (feature sensitive) SPL LIFT (graph encoding): Evaluation and Results: A1 vs SPL LIFT

[ 13 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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 L feature in-sensitive! N = O (2 F ) compilations!

[ 14 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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!

[ 15 ] Dataflow Analysis for Software Product Lines May, 2013 SSS x++; + ({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!

[ 16 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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 BDD representation ! (compact+efficient) - 0/+ i.e., invalid given wrt. the feature model, ψ ! ψ FM = A ∨ B L 0 ∧ ¬A ∧A∧A + ∧ ¬B ∧B∧B ∧B∧B feature sensitive!

[ 17 ] Dataflow Analysis for Software Product Lines May, 2013 SSS true [ (A ∧ B) ∧ ¬A] ∨ [ true ∧ A] = A true A∧BA∧B true ∧ ¬A = ¬A true SPL LIFT IFDS:A0: λS. (S – {x}) ∪ {y} {x} {y} SPL LIFT (IFDS ➞ IDE):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:A: #ifdef (A) ( {A} = {y}, {B} = {x}, {A,B} = {y} ) A ¬A LIFT: ■Reps ■Horwitz ■Sagiv fixed-point iteration graph reachability ➔ ¬AA

[ 18 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Introduction: Software Product Lines (SPL) Dataflow Analysis (DFA) DFA-4-SPL: A0 (brute force): (feature in-sensitive) A1 (consecutive): (feature sensitive) A2 (simultaneous): (feature sensitive) A3 (shared simultaneous): (feature sensitive) SPL LIFT (graph encoding): Evaluation and Results: A1 vs SPL LIFT

[ 19 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Results Results for SPL LIFT (interprocedural analysis): In fact, analyzing all valid configs is only slightly slower than analyzing one config ! "Statically Analyzing Software Product Lines... in Minutes instead of Years" :-) Reaching DefinitionsPossible TypesUninitialized Variables SPL benchmark # valid configs A1SPL LIFT A1SPL LIFT A1SPL LIFT Lampiro43m30s42s13s4s3m09s1m25s MM m29s59s2m06s3s27m39s2m13s GPL1,872days8m48s9h03m39s42sdays7m09s Berkeley DB unknown years12m04syears24syears10m18s

Dataflow Analysis for Software Product Lines May, 2013 SSS *) Thanks

Dataflow Analysis for Software Product Lines May, 2013 SSS BONUS SLIDES

[ 22 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Overview A0 (brute force) A1 (consecutive) A2 (simultaneous) A3 (shared) A* (combo) IFDS ➞ IDE (lift) FASTER (intra-procedural) PLDI 2013 IFDS (graph repr) A3+BDD (esp. inter- procedural) no re-compile! caching! sharing! combo! graph encoding! repr! AOSD 2012 TAOSD 2013

[ 23 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Errors Logo 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}}

[ 24 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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

[ 25 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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 case Uses (hardwired) DFA (w/o FM) to compute reachability (similar techniques, diff goal): Split and merging parsing (~A3) and also uses instrumentation

[ 26 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Emerging Interfaces

[ 27 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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:

[ 28 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Summary A0 A1 A2 A3 void m() { int x=0; ifdef(A) x++; ifdef(B) x--; } Analyzing program: ψ FM = A ∨ B

[ 29 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Specification: A0, A1, A2, A3 A0 A1 A2 A3

[ 30 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Evaluation Five (qualitatively different) SPL benchmarks:

[ 31 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Total Time (incl. compile) In practice: 4x (Reaching Definitions) 7x 3x 1x ( no re-compile !) Feature sensitive (A1, A2, and A3) all faster than A0

[ 32 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Analysis Time (excl. compile) In practice: ( caching !) (Reaching Definitions) A2 faster than A1 A3 faster than A2 ( sharing !)

[ 33 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Beyond the Sum of all Methods For a method with x # 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).

[ 34 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Combo Analysis Strategy: A * Intraprocedurally combined analysis strategy, A*: A* consistently fastest ( combo !)

[ 35 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Analysis Time (excl. compile) In theory: In practice: T IME ( A 3 ) : Depends on degree of sharing in SPL ! ( caching !) (Reaching Definitions) A2 faster than A1 A3 faster than A2 ( sharing !)

[ 36 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Memory Usage In theory: In practice: (Reaching Definitions) S PACE ( A 3 ) : Depends on degree of sharing in SPL !

[ 37 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Analysis Time (excl. compile) In practice: (Reaching Definitions) Nx1 ≠ 1xN ?! Caching! A2 faster than A1

[ 38 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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!

[ 39 ] Dataflow Analysis for Software Product Lines May, 2013 SSS IFDEF normalization Refactor "undisciplined" (lexical) ifdefs into "disciplined" (syntactic) ifdefs: Normalize "ifdef"s (by transformation):

[ 40 ] Dataflow Analysis for Software Product Lines May, 2013 SSS 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

[ 41 ] Dataflow Analysis for Software Product Lines May, 2013 SSS BDD (Binary Decision Diagram) Compact and efficient representation for boolean functions (aka., set of set of names) FAST: negation, conjunction, disjunction, equality !  =  F(A,B,C) =F(A,B,C) = A  (B  C)   A C minimized BDD B    A BB CCCC BDD

[ 42 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Formula ~ Set of Configurations Definitions (given F, set of feature names): f  F feature name c  2 F configuration ( set of feature names ) c  F X  2 2 set of config's ( set of set of feature names ) X  2 F Example ifdef s: F [[ B  A ]] [[ A  (B  C) ]] F = {A,B} F = {A,B,C} = { {A}, {B}, {A,B} } = { {A,B}, {A,C}, {A,B,C} }

[ 43 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Feature Model (Example) Feature Model: Feature set: Formula: Set of configurations:  FM  Car  Engine  (1.0  1.4)  Air  1.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 = |2 F | [[ ]] = Engine 1.0 Air 1.4

[ 44 ] Dataflow Analysis for Software Product Lines May, 2013 SSS Conditional Compilation The ' ifdef ' construction: Syntactic variant of lexical #ifdef Propositional Logic: where f  F (finite set of feature names) Example: STM : 'ifdef' '('  ')' STM  : f  F |  |  status.print("you die"); ifdef (DeluxeVersion && ColorDisplay) { player.redraw(Color.red); Audio.play("crash.wav"); } lives = lives - 1; A ifdef (A) {... }

[ 45 ] Dataflow Analysis for Software Product Lines May, 2013 SSS CASE 1: "COPY" A3: Lazy Splitting (using BDDs) CASE 2: "APPLY"CASE 3: "SPLIT"  : S [  = l,... ] l ' = f S ( l )      : S [  = l,... ] [  = l ',... ] l ' = f S ( l )  : S [  = l,... ] [  = l,  = l',...] l ' = f S ( l )   = Ø  =  Ø    

[ 46 ] Dataflow Analysis for Software Product Lines May, 2013 SSS A0, A1, A2, and A3 A0 A1 A2 A3