on the impact of feature dependencies when maintaining preprocessor-based software product lines

28
On the Impact of Feature Dependencies when Maintaining Preprocessor‐based So<ware Product Lines Márcio Ribeiro Felipe Queiroz Paulo Borba Társis Tolêdo Claus Brabrand Sérgio Soares {mmr3, Cq, phmb, twt, scbs}@cin.ufpe.br [email protected]

Post on 14-Sep-2014

162 views

Category:

Education


1 download

Tags:

DESCRIPTION

Presentation at 10th International Conference on Generative Programming and Component Engineering (GPCE 2011)

TRANSCRIPT

Page 1: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

OntheImpactofFeatureDependencieswhenMaintaining

Preprocessor‐basedSo<wareProductLines

MárcioRibeiroFelipeQueirozPauloBorba

TársisTolêdoClausBrabrandSérgioSoares

{mmr3,Cq,phmb,twt,scbs}@cin.ufpe.br

[email protected]

Page 2: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

VirtualSeparaKonofConcerns(VSoC)

2

Page 3: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

ButnotenoughforFeatureModularity…

3

Page 4: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Problem

4

 Developerscanintroducecompila?onandbehavioralerrorstofeaturesduetofeaturedependencies…

Page 5: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

…leadingtolowerproducKvity

 LateerrordetecKon  Developersdiscovertheproblemonlywhencompilingandexecu?ngtheproblema?cproduct

 DifficultnavigaKon  Developersnotawareoffeaturedependencies

  EvenworsewhenusingVSoC:featuresarehidden!

5

Page 6: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

6

Tominimizetheseproblems:

EmergentInterfaces

Page 7: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

EmergentInterfacesinanutshell

7

Page 8: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Dependenciescaptured!Developerscanfocusontheimpactedfeatures…

8

Page 9: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

9

Featuredependenciescancauseproblems

Page 10: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

10

EmergentInterfacescomplementVSoC

Page 11: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Agenda

11

Page 12: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Studysecngs

 43Preprocessor‐basedSoMwareProductlines  JavaandC  Differentsizesanddomains

 Scripttoolforcompu?ngtwometrics: MDi:numberofmethodswithpreprocessordirec?ves MDe:numberofmethodswithfeaturedependencies

12

Page 13: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Featuredependenciesourtoolconsiders

13

Page 14: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

EffortesKmaKon:VSoCvs.EmergentInterfaces

14Num

berofFragm

ents

Num

berofFeatures

Page 15: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

MethodsselecKon

 Randomlymethodsselec?on  Only methods that contain the feature dependencieswefocusonthiswork

 Whichmethodsshouldweselect? Manyfragments:favoringemergentinterfaces

  Fewfragments:nodifferences

15

Page 16: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Groups

 Twogroups:

 Why2asathreshold?  Differencesbetweenbothapproachesappearfrom2

  1:bothapproacheshavealwaysthesameeffortes?ma?on

16

Page 17: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

MethodsselecKontofitthegroups

 Propor?onalselec?onaccordingtoeachSPL

 Example:libxml2  Group1:953methods(8methodsselected)  Group2:125methods(1methodselected)

 Majority(23productlines)  1:1

17

Page 18: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

GeneralalgorithmforeffortesKmaKon

 Whilewedonotreach3replica?ons  Foreachproductline

  Randomlyselectmethodspropor?onallyaccording to thegroups

  Foreachmethod  Randomlyselectavariable

  From this variable, computeNoFa,NoFe, and LOC for bothapproaches

18

Page 19: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

19

Results

Page 20: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

20

QuesKon1:howoMenmethodswithpreprocessordirec?vescontainfeature

dependencies?

Page 21: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Frequencyoffeaturedependencies

21

MethodswithDependencies

MethodswithDirecKves

Page 22: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Ourdatarevealthat…

 Methods with direc?ves that also contain thefeaturedependencieswestudied: Max:88%(mobile‐rss)

 Min:12%(lampiro)

 So, the featuredependenciesweconsideredmaybecommoninthe43SPLsweanalyzed  Only6SPLshaveMDe/MDi<50%

22

Page 23: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

23

QuesKon2:howfeaturedependenciesimpact

maintenanceeffortwhenusingVSoCandemergent

interfaces?

Page 24: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

SelecKon:methods,groups,SPLs

 Foreachreplica?on:115methods

 Methodsselec?onaccordingtoeachproductline

24

Page 25: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

EmergentInterfaceseffortesKmaKon

 Effortes?ma?oninallSPLs

 Methodsdistribu?onbygroups:

25

Page 26: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Whenincreasingthenumberoffragments…

26

 … the percentage of methods where EmergentInterfacesachieveeffortreduc?onalsoincreases…

65%

70%

75%

80%

85%

90%

95%

100%

>2 >3 >4 >5 >6

Replica?on1

Replica?on2

Replica?on3

EsKmaK

onofEffortred

ucKon

NumberofFragments

Page 27: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Threatstovalidity

 Metricsandeffortes?ma?on  Timebehermeasureseffort…  …butthemetricsares?lluseful

  Overheadtocomputeemergentinterfaces

 Dependencies  Interprocedural,chainofassignments…(notcomputed)

  So,thenumberswepresentedmightbeevenhigher…

27

Page 28: On the Impact of Feature Dependencies when Maintaining Preprocessor-based Software Product Lines

Concludingremarks

28

 How oMen the feature dependencies we analyzedoccurinprac?ce? Max:88%;Min:12%;Majority>50%

 Emergentinterfacescanachieveeffortreduc?on  For the majority of the studied methods (65%): sameeffortofVSoC

  Nega?veimpactofVSoCisnotsocommon

 More significant effort reduc?ons: methods withmanyfragments(Group1)