static analysis of software product lines

Download Static  Analysis  of Software Product Lines

If you can't read please download the document

Post on 25-Feb-2016

45 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

[ DFA - 4 - SPL ] ( AOSD 2012 ). [ SPL LIFT ] ( PLDI 2013 ). [ Var - Abs - Int ] ( in progress.. ). Static Analysis of Software Product Lines. Claus Brabrand. Paulo Borba. Márcio Ribeiro. Társis Tolêdo. Eric Bodden. Mira Mezini. Jan Midtgaard. Andrzej Wąsowski. - PowerPoint PPT Presentation

TRANSCRIPT

Past and Future Research

Static Analysis ofSoftware Product Lines

Jan Midtgaard

Andrzej Wsowski Claus Brabrand

Paulo Borba

Mira Mezini

Eric Bodden

Mrcio Ribeiro

Trsis Toldo[ DFA-4-SPL ]( AOSD 2012 )[ SPLLIFT ]( PLDI 2013 )[ Var-Abs-Int ](in progress..)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting< Outline >Introduction:Software Product Lines (SPL)Dataflow Analysis (DFA)DFA-4-SPL:A0 (brute force) (feature in-sensitive)A1 (consecutive)A2 (simultaneous)A3 (shared simultaneous)SPLLIFT (graph encoding)Evaluation and ResultsSketch of Work in Progress: "Var-Abs-Int"(feature sensitive)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingIntroduction1x CAR

=1x CELL PHONE

=1x APPLICATION

=

CARSCELL PHONES

APPLICATIONSTraditional Software Development:One program = One product

Product Line:A family of products (of N similar products):

customizeSPL:(Family ofPrograms)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingSoftware Product LineSPL:

Feature Model: (e.g.: FM VIDEO COLOR)Family ofPrograms:COLORVIDEOCOLORVIDEOVIDEO{ Video }{ Color, Video }

Configurations:, {Color}, {Video}, {Color,Video}VALID{ Color }customize2FSet of Features:F = { COLOR, VIDEO }2F[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingSoftware Product LineSPLs based on Conditional Compilation:

#ifdef ( )

...

#endifLogo logo;...

...logo.use();#ifdef (VIDEO) logo = new Logo();#endifExample(SPL fragment)*** null-pointer exception!in configurations: {, {COLOR}} : fF | | [ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meetingresultresult01001011110110101001111101110100101111011010100111110111Analysis of SPLsThe Compilation Process:

...and for Software Product Lines:0100101111011010100111110111resultcompilerunERROR!

generate0100101111011010100111110111resultrunERROR!

ANALYZE!

ANALYZE!Feature-sensitive data-flow analysis !runruncompilecompilecompileANALYZE!ANALYZE!ERROR!ERROR!2F

[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingDataflow AnalysisDataflow Analysis:1) Control-flow graph2) Lattice (finite height)3) Transfer functions (monotone)L

Example:"sign-of-x analysis"[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingAnalyzing a Program

1) Program2) Build CFG3) Make Equations4) Solve equations: fixed-point computation (iteration)5) SOLUTION (least fixed point): Annotated with program points[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting< Outline >Introduction:Software Product Lines (SPL)Dataflow Analysis (DFA)DFA-4-SPL:A0 (brute force) (feature in-sensitive)A1 (consecutive)A2 (simultaneous)A3 (shared simultaneous)SPLLIFT (graph encoding)Evaluation and ResultsSketch of Work in Progress: "Var-Abs-Int"(feature sensitive)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingDataflow Analysis forSoftware Product LinesDFA-4-SPLClaus BrabrandIT University of CopenhagenUniversidade Federal de Pernambuco[ brabrand@itu.dk ]Mrcio RibeiroUniversidade Federal de AlagoasUniversidade Federal de Pernambuco[ mmr3@cin.ufpe.br ]Paulo BorbaUniversidade Federal de Pernambuco[ phmb@cin.ufpe.br ]Trsis ToledoUniversidade Federal de Pernambuco[ twt@cin.ufpe.br ]

AOSD 2012 and TAOSD 2013"Intraprocedural Dataflow Analysis for Software Product Lines"[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingA0A0(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 = ABL

feature in-sensitive!N = O(2F) compilations![ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meetingint x = 0;x++;x--;A:B:int x = 0;x++;x--;A:B:int x = 0;x++;x--;A:B:A1A1(consecutive):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}c = {A}:0_|+FM = ABL

c = {B}:c = {A,B}:0_|-0_|0/+++0feature sensitive!N = O(2F) fixp iterations![ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meetingx++;+({A} = , {B} = , {A,B} = )({A} = , {B} = , {A,B} = )({A} = , {B} = , {A,B} = )A2A2(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 = ABL

0+feature sensitive!L

L

{A} {B} {A,B}L = [ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meetingx--;+x++;0( [[A ]] = , [[A ]] = , [[A ]] = , [[A ]] = )( [[ ]] = , [[ ]] = )A3A3(shared sim.):void m() { int x=0; ifdef(A) x++; ifdef(B) x--;}FM = AB:int x = 0;A:B:_|( [[]] = )0( [[]] = )(AB)AB falsecan use BDDrepresentation !(compact+efficient)-0/+i.e., invalid given wrt.the feature model, !FM = AB0AA+BBBBfeature sensitive!L

L

L

{A} {B} {A,B}L = [ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingStatically AnalyzingSoftware Product Linesin Minutes instead of YearsSPLLIFTPLDI 2013Eric BoddenTechnische Universitt Darmstadt[ bodden@acm.org ]Trsis ToldoUniversidade Federal de Pernambuco[ twt@cin.ufpe.br ]Mrcio RibeiroUniversidade Federal de Alagoas[ mmr3@cin.ufpe.br ]

Mira MeziniTechnische Universitt Darmstadt[ mira.mezini@cased.de]Claus BrabrandIT University of Copenhagen[ brabrand@itu.dk ]

Paulo BorbaUniversidade Federal de Pernambuco[ phmb@cin.ufpe.br ]

"Statically Analyzing Software Product Lines in Minutes instead of Years"[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meetingtrue[ (AB)A] [ trueA]= AtrueABtrueA = AtrueSPLLIFTIFDS:A0:S . (S {x}) {y}{x}{y}SPLLIFT (IFDS IDE):A2:( {A} = {x} , {B} = {x} , {A,B} = {x,y} )0xy0xy0xy0xy S . (S {x}) {y}A:#ifdef (A)( {A} = {y} , {B} = {x} , {A,B} = {y} )AAALIFT:RepsHorwitzSagivfixed-pointiterationgraphreachabilityAA{x}{y}{x,y}[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting< Outline >Introduction:Software Product Lines (SPL)Dataflow Analysis (DFA)DFA-4-SPL:A0 (brute force) (feature in-sensitive)A1 (consecutive)A2 (simultaneous)A3 (shared simultaneous)SPLLIFT (graph encoding)Evaluation and ResultsSketch of Work in Progress: "Var-Abs-Int"(feature sensitive)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingResultsResults for SPLLIFT (interprocedural analysis):

In fact, analyzing all valid configs is only slightly slower than analyzing one config !

Minutes instead of Years ! :-)Reaching DefinitionsPossible TypesUninitialized VariablesSPL benchmark# validconfigsA1SPLLIFTA1SPLLIFTA1SPLLIFTLampiro43m30s42s13s4s3m09s1m25sMM 082624m29s59s2m06s3s27m39s2m13sGPL1,872days8m48s9h03m39s42sdays7m09sBerkeley DBunknownyears12m04syears24syears10m18s[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting< Outline >Introduction:Software Product Lines (SPL)Dataflow Analysis (DFA)DFA-4-SPL:A0 (brute force) (feature in-sensitive)A1 (consecutive)A2 (simultaneous)A3 (shared simultaneous)SPLLIFT (graph encoding)Evaluation and ResultsSketch of Work in Progress: "Var-Abs-Int"(feature sensitive)[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingSystematic Derivation of Static Analyses for Software Product LinesVar-Abs-IntJan MidtgaardAarhus University[ jmi@cs.au.dk ]Claus BrabrandIT University of Copenhagen[ brabrand@itu.dk ]Andrzej WsowskiIT University of Copenhagen[ wasowski@itu.dk ]I n p r o g r e s s . . .

"Systematic Derivation of Static Analyses for Software Product Lines"[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting

LiftedLiftedLiftedLiftedVar-Abs-Int"Systematic Derivation of Analyses for SPLs":

...

LiftedSPL[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingQuestions ?Thx[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingAbstractSoftware 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.We demonstrate how to take any standard dataflow analysis and automatically turn it into a feature-sensitive dataflow analysis in several qualitatively different ways. All analyses are capable of analyzing all valid products of an SPL without having to generate all of them explicitly.[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingExample SPL

config = {G}(FGH)customize(instantiate)(preprocess)Software Product Line:Conventional Program:[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingExploded Super Graph

...for Program:[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingLifted Exploded Super Graph

...for SPL:[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting

independent options...> Earth's Population (233)[ C. Kstner ]33 [ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting

> Atoms in Universe (2320)[ C. Kstner ]independent options...320 [ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab Meeting

[ C. Kstner ]10 000configurableoptions...[ # ]"Static Analysis of Software Product Lines"Aug 9, 2013MT Lab MeetingSpecification: A1, A2, A3, A4

Recommended

View more >