XTREES Discovering Useful Changes for Software Projects Rahul Krishna ([email protected]), Tim Menzies, CS @ NcState
XTREESDiscoveringUsefulChanges
forSoftwareProjectsRahulKrishna([email protected]),
TimMenzies,CS@NcState
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
39 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
CodeSmell Study Findings
Duplicate CodeJürgensetal. Duplicate codecontained morefaultsthanaverage
Rahmanetal. Mostdefectivecodewerenotsignificantlyassociatedwith duplicatecode
49 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
CodeSmell Study Findings
Duplicate CodeJürgensetal. Duplicate codecontained morefaultsthanaverage
Rahmanetal. Mostdefectivecodewerenotsignificantlyassociatedwith duplicatecode
GodClassDeligiannisetal. GodClasseshavedetrimental effect
Olbrich etal. GodClasseshavepositiveeffects
59 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
CodeSmell Study Findings
Duplicate CodeJürgensetal. Duplicate codecontained morefaultsthanaverage
Rahmanetal. Mostdefectivecodewerenotsignificantlyassociatedwith duplicatecode
GodClassDeligiannisetal. GodClasseshavedetrimental effect
Olbrich etal. GodClasseshavepositiveeffects
ShotgunsurgeryLietal. ShotgunSurgerywaspositivelyassociatedwithsoftwarefaults
D'Ambrosetal. ShotgunSurgerywasnot consistent withdefectsacrosssystems
69 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
• Thiscontradictioncanalsobeseeninseveralwidelyusedtools
79 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
NoConsensus!
• Thereseemstobecontradictingconclusionsontheimpactofcodesmellsonsystems[1]
• Thiscontradictioncanalsobeseeninseveralwidelyusedtools
CodeSmell SonarQube Rank[13] JeffAtwood[14] OurclientsLazyClass/Freeloader L M HMessage Chains H HSpeculativeGenerality H LSwitchStatements L L
89 November 2015
[1] Dag I.K. Sjoberg, Aiko Yamashita, Bente C.D. Anda, Audris Mockus, Tore Dyba, "Quantifying the Effect of Code Smells on Maintenance Effort," IEEE Transactions on Software Engineering, vol. 39, no. 8, pp. 1144-1156, Aug., 2013
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• Doesthiswork?
• Canwereducedefects?• Canweoptimizeruntimes?
• FutureWork• Summary
169 November 2015
CommentsonPlanningAgents
AGoodPlanner
1. IdentifyBadOptions
2. Discoverpossiblesetofgoodoptions
3. Offereffectiveandsuccinctsummaries
179 November 2015
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• Doesthiswork?
• Canwereducedefects?• Canweoptimizeruntimes?
• FutureWork• Summary
199 November 2015
WhatarePlans?
• Plansarechangestospecificproblems• Specifically,foreverytestexample inZ,aplan∆ isusedtoadjustZj
• Itcan,forinstance,beusedtoreducethenumberofdefects
219 November 2015
WhatarePlans?
• Plansarechangestospecificproblems• Specifically,foreverytestexample inZ,aplan∆ isusedtoadjustZj
• Itcan,forinstance,beusedtoreducethenumberofdefects
229 November 2015
WhatarePlans?
• Plansarechangestospecificproblems• Specifically,foreverytestexample inZ,aplan∆ isusedtoadjustZj
• Itcan,forinstance,beusedtoreducethenumberofdefects
∀δ j ∈Δ :Z j =Z j +δ j if Z j is numeric
δ j otherwise
⎧⎨⎪
⎩⎪
239 November 2015
WhatarePlans?
• Plansarechangestospecificproblems• Specifically,foreverytestexample inZ,aplan∆ isusedtoadjustZj
• Itcan,forinstance,beusedtoreducethenumberofdefects
∀δ j ∈Δ :Z j =Z j +δ j if Z j is numeric
δ j otherwise
⎧⎨⎪
⎩⎪
249 November 2015
BTW:Planningisnotoptimization
259 November 2015
• Wewishtotreatallmembersofthepopulation
• Notelect foranelite few
• Sowewon’tuseNSGA-II,SPEA2,NSGA-III,MOEA/D,DE,etc.
BTW:Planningisnotoptimization
269 November 2015
• Wewishtotreatallmembersofthepopulation
• Notelect foranelite few
• Sowewon’tuseNSGA-II,SPEA2,NSGA-III,MOEA/D,DE,etc.
BTW:Planningisnotoptimization
• Wewishtotreatallmembersofthepopulation
• Notelect foranelite few
• Sowewon’tuseNSGA-II,SPEA2,NSGA-III,MOEA/D,DE,etc.
279 November 2015
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• Doesthiswork?
• Canwereducedefects?• Canweoptimizeruntimes?
• FutureWork• Summary
289 November 2015
XTREE
359 November 2015
Ensure a class only contains methods that interact with each other
Refactor such that cohesion among methods improves
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• Doesthiswork?
• Canwereducedefects?• Canweoptimizeruntimes?
• FutureWork• Summary
369 November 2015
Doesthiswork?Canwereducedefects?
• 5SampleprojectsfromJureczkoOOdataset[17] — Ant,Ivy,Lucene,Poi,andJedit
• Datasetcontainsacollectionof20OOmeasures,andabugcount.
Canwereduceruntimes?• 6systemsfromSiegmund etal.[18]— Apache,SQLite,LLVM,x264andtwoversionsoftheBerkeleydatabase(onewrittenin“C”andoneinJava)
• Thedatasetrecordstheruntimesofcompiledsystemsmeasuredusingstandardbenchmarking tools.
379 November 2015
Doesthiswork?Canwereducedefects?
• 5SampleprojectsfromJureczkoOOdataset[17] — Ant,Ivy,Lucene,Poi,andJedit
• Datasetcontainsacollectionof20OOmeasures,andabugcount.
Canwereduceruntimes?• 6systemsfromSiegmund etal.[18]— Apache,SQLite,LLVM,x264andtwoversionsoftheBerkeleydatabase(onewrittenin“C”andoneinJava)
• Thedatasetrecordstheruntimesofcompiledsystemsmeasuredusingstandardbenchmarking tools.
389 November 2015
AnalysisMethods
Performancecanbeassessedusing3criteria1. Effectiveness:Measuredas%Improvement.Denoted
byR,
2. Succinctness:Howmanyattributesneed tomodified togetadesiredresult
3. Stability:Resultsmustberepeatable.
399 November 2015
AnalysisMethods
Performancecanbeassessedusing3criteria1. Effectiveness:Measuredas%Improvement.Denoted
byR,
2. Succinctness:Howmanyattributesneed tomodified togetadesiredresult
3. Stability:Resultsmustberepeatable.
409 November 2015
AnalysisMethods
Performancecanbeassessedusing3criteria1. Effectiveness:Measuredas%Improvement.Denoted
byR,
2. Succinctness:Howmanyattributesneed tomodified togetadesiredresult
3. Stability:Resultsmustberepeatable.
419 November 2015
Jureczko:EffectivePlans(20Repeats)
429 November 2015
PriorworkPROMISE’12:Deltabetweenclustercentroids
Jureczko:EffectivePlans(20Repeats)
439 November 2015
PriorworkPROMISE’12:Deltabetweenclustercentroids
% Improvements in 20 repeats
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• ExperimentalResults
• JureczkoDefectDatasets• Seigmund Datasets
• FutureWork• Summary
469 November 2015
Roadmap
• WhyPlan?• CommentsonPlanningAgents• WhatarePlans?• XTREE• ExperimentalResults
• JureczkoDefectDatasets• Seigmund Datasets
• FutureWork• Summary
489 November 2015