SlideShare a Scribd company logo
1 of 37
Download to read offline
Fabio Palomba
DETECTING BAD SMELLS IN SOURCE CODE
USING CHANGE HISTORY INFORMATION
Universityofsalerno
fisciano,27/09/2013
Candidate:
Fabio Palomba
@fabiopalomba3
ADVISORS:
Andrea De Lucia
Gabriele Bavota
sabato 28 settembre 13
TODAY, I’LL SPEAK ABOUT...
Bad Code: causes and effects
Software Evolution and Code Quality
HIST: Historical Information for
Smell deTection
A Method to Detect Bad Smells using
Historical Informations
sabato 28 settembre 13
SOFTWARE EVOLUTION
AND CODE QUALITY
PART I
sabato 28 settembre 13
Cohesion
Coupling
W. Stevens, G. Myers, and L. Constantine. Structured design. IBM Systems Journal,
13(2):115 - 139, 1974.
sabato 28 settembre 13
sabato 28 settembre 13
Victor R. Basili, Lionel C. Briand, and Walcélio L. Melo.A validation of object-
oriented design metrics as quality indicators. IEEETransactions on Software
Engineering, 22(10):751 - 761, 1996.
L. C. Briand, J.Wüst, J.W. Daly, andV. D. Porter. Exploring the relationship between
design measures and software quality in object- oriented systems. Journal of
Systems and Software (JSS), 51(3):245 - 273, 2000.
DEFECTS
sabato 28 settembre 13
COMPREHENSIBILITY
M.Abbes, F. Khomh,Y.-G. Guéhéneuc, and G.Antoniol,“An empirical study of the impact
of two antipatterns, blob and spaghetti code, on program comprehension,” in 15th
European Conference on Software Maintenance and Reengineering, CSMR 2011.
sabato 28 settembre 13
Tibor Gyimóthy, Rudolf Ferenc, and István Siket. Empirical validation of object-
oriented metrics on open source software for fault prediction. IEEETransactions
on Software Engineering (TSE), 31(10):897 - 910, 2005.
PRODUCTIVITY
sabato 28 settembre 13
2 - 100
MAINTENANCE COSTS ARE
GREATER THAN DEVELOPMENT COSTS
R.D. Banker, S. M. Datar, C. F. Kemerer, D. Zweig. Software complexity and
maintenance costs. Communications of the ACM, v.36 n.11, pages 81 - 94, 1993.
sabato 28 settembre 13
HIST:
HISTORICAL
INFORMATION
FOR SMELL
DETECTION
PART II
sabato 28 settembre 13
An AntiPattern is a literary form that describes a
commonly occurring solution to a problem that
generates decidedly negative consequences
William H. Brown, Raphael C. Malveau, Hays W. McCormick,Thomas J. Mowbray -
Antipatterns: Refactoring Software,Architectures and Project in Crisis
22 14
BAD SMELLS: DEFINITION
DEVELOPMENT ANTIPATTERNSsabato 28 settembre 13
DETECTION VIA STRUCTURAL ANALYSIS
“Code smell are structural characteristics of software
that may indicate a code or design problem.”
F. Fontana et al. - “Automatic detection of bad smells in code:An experimental assessment”, Journal of ObjectTechnology
sabato 28 settembre 13
DETECTION VIA STRUCTURAL ANALYSIS
“Code smell are structural characteristics of software
that may indicate a code or design problem.”
Many bad smells are intrinsically characterized
by how code elements change over time,
rather than by structural properties!
F. Fontana et al. - “Automatic detection of bad smells in code:An experimental assessment”, Journal of ObjectTechnology
sabato 28 settembre 13
BLOB Feature
envy
Divergent
change
shotgun
surgery
Parallelinheritance
hierarchies
sabato 28 settembre 13
HIST PROCESS
sabato 28 settembre 13
HIST PROCESS
sabato 28 settembre 13
EXTRACTING CHANGE HISTORY
Changes at method-level are captured
using a code-analyzer developed in
the Markos European Project*
* http://markosproject.berlios.de
sabato 28 settembre 13
HIST PROCESS
sabato 28 settembre 13
HIST PROCESS
sabato 28 settembre 13
DETECTION ALGORITHMS
Divergent change occurs when one class is commonly
changed in different ways for different reasons.
Classes having at least two sets of methods
changing together but independently
from methods in the other sets
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
DETECTION ALGORITHMS
Divergent change occurs when one class is commonly
changed in different ways for different reasons.
Classes having at least two sets of methods
changing together but independently
from methods in the other sets
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
DETECTION ALGORITHMS
Divergent change occurs when one class is commonly
changed in different ways for different reasons.
Classes having at least two sets of methods
changing together but independently
from methods in the other sets
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
MINING VERSION HISTORIES THROUGH
ASSOCIATION RULE DISCOVERY
C
E
D
B
A
Files
Changesoccurringinsnapshots
S1 S2 S3 S4 S5 S6 S7 S8
Thomas Zimmermann, Peter Weißgerber, Stephan Diehl,Andreas Zeller: MiningVersion Histories to Guide
Software Changes. ICSE 2004: 563-572
AnnieT.T.Ying, Gail C. Murphy, RaymondT. Ng, Mark Chu-Carroll: Predicting Source Code Changes by Mining
Change History. IEEETrans. Software Eng. 30(9): 574-586 (2004)
A
C
B
D
A
D
B
D
E
A
C
B
D
E
A
C
sabato 28 settembre 13
MINING VERSION HISTORIES THROUGH
ASSOCIATION RULE DISCOVERY
C
E
D
B
A
Files
Changesoccurringinsnapshots
S1 S2 S3 S4 S5 S6 S7 S8
Thomas Zimmermann, Peter Weißgerber, Stephan Diehl,Andreas Zeller: MiningVersion Histories to Guide
Software Changes. ICSE 2004: 563-572
AnnieT.T.Ying, Gail C. Murphy, RaymondT. Ng, Mark Chu-Carroll: Predicting Source Code Changes by Mining
Change History. IEEETrans. Software Eng. 30(9): 574-586 (2004)
A
C
B
D
A
D
B
D
E
A
C
B
D
E
A
C
sabato 28 settembre 13
Classes containing at least one method
changing together with methods
contained in more than δ(δ=3) different classes
DETECTION ALGORITHMS
You have a Shotgun Surgery when every time you make
a kind of change, you have to make a lot of little changes to
a lot of different classes.
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
Pairs of classes for which the addition
of a subclass implies the addition of a subclass
for the other class
You have a Parallel Inheritance Hierarchies when
every time you make a subclass of one class, you also have to
make a subclass of another.
DETECTION ALGORITHMS
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
DETECTION ALGORITHMS
A Blob is a class implementing several responsibilities, having
a large number of attributes, operations and dependencies
with data classes.
Classes modified (in any way) in more than α%
(α =8) commits involving at least another class
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
DETECTION ALGORITHMS
A Feature Envy occurs when a method is more interested
in a class other than the one it is actually in.
Methods involved in commits with methods of
another class of the system β% (β =70) more
than commits with methods of their class
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
EMPIRICAL EVALUATION
sabato 28 settembre 13
CASE STUDY DESIGN
RQ1:Which are the performance of
HIST in detecting bad smells?
RQ2: How does HIST compares to the
techniques based on structural analysis?
RQ System Metrics
ApacheTomcat
Apache Ant
JEdit
5 API Android
ApacheTomcat
Apache Ant
JEdit
5 API Android
Precision
Recall
F-Measure
Precision
Recall
F-Measure
Correctti ∩ Correcttj
Correctti  Correcttj
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
sabato 28 settembre 13
10 % (20 - 7)
0 % (0 - 0)
7 % (4 - 45)
50 % (52 - 49)
63 % (68 - 60)
76 % (73 - 79)
89 % (80 - 100)
61 % (61 - 61)
68 % (76 - 61)
76 % (71 - 81)
RESULTS
Bad smell HIST Code analysis technique
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
Divergent Change
Shotgun Surgery
Parallel Inheritance
Blob
Feature Envy
F-Measure (Precision - Recall) F-Measure (Precision - Recall)
sabato 28 settembre 13
48 %
41 %
17 %
39 %
35 %
20 %
40 %43 % 17 %
RESULTS
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source
Code Using Change History Information”, in the 28th IEEE/ACM International Conference
on Automated Software Engineering (ASE’13), 2013
0 % 93 %
100 %0 %
7 %
0 %
Bad smell HIST ∩ CA HIST  CA CA  HIST
Divergent Change
Shotgun Surgery
Parallel Inheritance
Blob
Feature Envy
sabato 28 settembre 13
Conclusions & Future work
sabato 28 settembre 13
CONCLUSION
“This paper seems to bring some fresh air
into an area that has not seen
breakthroughs for some time.”
[One of the ASE Reviewers]
+ PRECISION
+ F - MEASURE
+ RECALL
+ Historical analysis for smell
detection
- Historical information is
needed
sabato 28 settembre 13
CAN WE DEFINE AN HYBRID
APPROACH TO DETECT BAD SMELLS?
sabato 28 settembre 13
CAN WE USE HIST TO DETECT
OTHER BAD SMELLS?
Spaghetti Code
Long Method
Complex Class
Refused Bequest
Duplicate Code
Primitive Obsession
Middle Man
Data Clump
sabato 28 settembre 13
Fabio Palomba
fabiopalomba13
fabio.palomba.89@gmail.com
http://www.linkedin.com/pub/fabio-palomba/4a/542/60
University of Salerno
DETECTING BAD SMELLS IN SOURCE CODE
USING CHANGE HISTORY INFORMATION
Thank you!
Questions and/or comments
sabato 28 settembre 13

More Related Content

What's hot

Social Debt Analytics for Improving the Management of Software Evolution Tasks
Social Debt Analytics for Improving the Management of Software Evolution TasksSocial Debt Analytics for Improving the Management of Software Evolution Tasks
Social Debt Analytics for Improving the Management of Software Evolution TasksFabio Palomba
 
ARIES: An Eclipse Plug-in To Support Extract Class Refactoring
ARIES: An Eclipse Plug-in To Support Extract Class RefactoringARIES: An Eclipse Plug-in To Support Extract Class Refactoring
ARIES: An Eclipse Plug-in To Support Extract Class RefactoringFabio Palomba
 
Software testing and concolic execution LSE 2013
Software testing and concolic execution LSE 2013Software testing and concolic execution LSE 2013
Software testing and concolic execution LSE 2013Jonathan Salwan
 
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsA Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsYuhao Wu
 
03. HAMS - Project Scheduling
03. HAMS - Project Scheduling03. HAMS - Project Scheduling
03. HAMS - Project SchedulingHAMSproject
 
IDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolIDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolAnthony Peruma
 
Investigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective FilesInvestigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective FilesThe University of Adelaide
 
Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsThe University of Adelaide
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...Anthony Peruma
 
Review Participation in Modern Code Review: An Empirical Study of the Android...
Review Participation in Modern Code Review: An Empirical Study of the Android...Review Participation in Modern Code Review: An Empirical Study of the Android...
Review Participation in Modern Code Review: An Empirical Study of the Android...The University of Adelaide
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...The University of Adelaide
 
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...The University of Adelaide
 
Exploiting Semantics-Based Plagiarism Detection Methods
Exploiting Semantics-Based Plagiarism Detection MethodsExploiting Semantics-Based Plagiarism Detection Methods
Exploiting Semantics-Based Plagiarism Detection MethodsIJSRED
 
Improving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer RecommendationsImproving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer RecommendationsThe University of Adelaide
 
The Use of Development History in Software Refactoring Using a Multi-Objectiv...
The Use of Development History in Software Refactoring Using a Multi-Objectiv...The Use of Development History in Software Refactoring Using a Multi-Objectiv...
The Use of Development History in Software Refactoring Using a Multi-Objectiv...Ali Ouni
 

What's hot (20)

Social Debt Analytics for Improving the Management of Software Evolution Tasks
Social Debt Analytics for Improving the Management of Software Evolution TasksSocial Debt Analytics for Improving the Management of Software Evolution Tasks
Social Debt Analytics for Improving the Management of Software Evolution Tasks
 
ARIES: An Eclipse Plug-in To Support Extract Class Refactoring
ARIES: An Eclipse Plug-in To Support Extract Class RefactoringARIES: An Eclipse Plug-in To Support Extract Class Refactoring
ARIES: An Eclipse Plug-in To Support Extract Class Refactoring
 
Software testing and concolic execution LSE 2013
Software testing and concolic execution LSE 2013Software testing and concolic execution LSE 2013
Software testing and concolic execution LSE 2013
 
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsA Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
 
03. HAMS - Project Scheduling
03. HAMS - Project Scheduling03. HAMS - Project Scheduling
03. HAMS - Project Scheduling
 
IDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolIDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal Tool
 
Who Should Review My Code?
Who Should Review My Code?  Who Should Review My Code?
Who Should Review My Code?
 
Investigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective FilesInvestigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective Files
 
Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review Analytics
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
 
Icsm20.ppt
Icsm20.pptIcsm20.ppt
Icsm20.ppt
 
Jsp Tin2010
Jsp Tin2010Jsp Tin2010
Jsp Tin2010
 
Review Participation in Modern Code Review: An Empirical Study of the Android...
Review Participation in Modern Code Review: An Empirical Study of the Android...Review Participation in Modern Code Review: An Empirical Study of the Android...
Review Participation in Modern Code Review: An Empirical Study of the Android...
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
 
CORRECT-ICSE2016
CORRECT-ICSE2016CORRECT-ICSE2016
CORRECT-ICSE2016
 
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Exploiting Semantics-Based Plagiarism Detection Methods
Exploiting Semantics-Based Plagiarism Detection MethodsExploiting Semantics-Based Plagiarism Detection Methods
Exploiting Semantics-Based Plagiarism Detection Methods
 
Improving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer RecommendationsImproving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer Recommendations
 
The Use of Development History in Software Refactoring Using a Multi-Objectiv...
The Use of Development History in Software Refactoring Using a Multi-Objectiv...The Use of Development History in Software Refactoring Using a Multi-Objectiv...
The Use of Development History in Software Refactoring Using a Multi-Objectiv...
 

Viewers also liked

A Series of Fortunate Events - PHP Benelux Conference 2015
A Series of Fortunate Events - PHP Benelux Conference 2015A Series of Fortunate Events - PHP Benelux Conference 2015
A Series of Fortunate Events - PHP Benelux Conference 2015Matthias Noback
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
 
A Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsA Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsChris Parnin
 
When and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadWhen and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadCarlos Eduardo
 
Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?Felienne Hermans
 
Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smellskim.mens
 
Code Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsCode Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsNikolaos Tsantalis
 
Architecture in an Agile World
Architecture in an Agile WorldArchitecture in an Agile World
Architecture in an Agile WorldDon McGreal
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?Tushar Sharma
 
Inversion of control
Inversion of controlInversion of control
Inversion of controlEmmet Irish
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Anshul Vinayak
 
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbRuby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbKoichiro Sumi
 

Viewers also liked (13)

A Series of Fortunate Events - PHP Benelux Conference 2015
A Series of Fortunate Events - PHP Benelux Conference 2015A Series of Fortunate Events - PHP Benelux Conference 2015
A Series of Fortunate Events - PHP Benelux Conference 2015
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014
 
A Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsA Catalogue of Code Smell Visualizations
A Catalogue of Code Smell Visualizations
 
When and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadWhen and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell Bad
 
Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?
 
Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smells
 
Code Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsCode Smell Research: History and Future Directions
Code Smell Research: History and Future Directions
 
Architecture in an Agile World
Architecture in an Agile WorldArchitecture in an Agile World
Architecture in an Agile World
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
Code smells
Code smellsCode smells
Code smells
 
Inversion of control
Inversion of controlInversion of control
Inversion of control
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)
 
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbRuby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
 

Similar to Detecting Bad Smells in Source Code using Change History Information

The 16th Intl. Workshop on Search-Based and Fuzz Testing
The 16th Intl. Workshop on Search-Based and Fuzz TestingThe 16th Intl. Workshop on Search-Based and Fuzz Testing
The 16th Intl. Workshop on Search-Based and Fuzz TestingSebastiano Panichella
 
OE_23_2015_11619-11631.pdf
OE_23_2015_11619-11631.pdfOE_23_2015_11619-11631.pdf
OE_23_2015_11619-11631.pdfKienBuiXuan3
 
Ingredients for Semantic Sensor Networks
Ingredients for Semantic Sensor NetworksIngredients for Semantic Sensor Networks
Ingredients for Semantic Sensor NetworksOscar Corcho
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Roberto Di Cosmo
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilab
 
Future Of Technology
Future Of  TechnologyFuture Of  Technology
Future Of TechnologyMelanie Swan
 
DEF CON 27 - BRENT STONE - reverse enginerring 17 cars
DEF CON 27 - BRENT STONE - reverse enginerring 17 carsDEF CON 27 - BRENT STONE - reverse enginerring 17 cars
DEF CON 27 - BRENT STONE - reverse enginerring 17 carsFelipe Prado
 
Syst biol 2012-burguiere-sysbio sys069
Syst biol 2012-burguiere-sysbio sys069Syst biol 2012-burguiere-sysbio sys069
Syst biol 2012-burguiere-sysbio sys069Thomas Burguiere
 
A semantics based approach to malware detection
A semantics based approach to malware detectionA semantics based approach to malware detection
A semantics based approach to malware detectionUltraUploader
 
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...Sebastiano Panichella
 
36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructureWashington Garcia
 
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...On the Relevance of Code Anomalies for Identifying Architecture Degradation S...
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...roberta arcoverde
 
Yuri A. Ivanov
Yuri A. IvanovYuri A. Ivanov
Yuri A. Ivanovbutest
 
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...Codemotion
 

Similar to Detecting Bad Smells in Source Code using Change History Information (20)

The 16th Intl. Workshop on Search-Based and Fuzz Testing
The 16th Intl. Workshop on Search-Based and Fuzz TestingThe 16th Intl. Workshop on Search-Based and Fuzz Testing
The 16th Intl. Workshop on Search-Based and Fuzz Testing
 
OE_23_2015_11619-11631.pdf
OE_23_2015_11619-11631.pdfOE_23_2015_11619-11631.pdf
OE_23_2015_11619-11631.pdf
 
Seeing Software
Seeing SoftwareSeeing Software
Seeing Software
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
 
Ingredients for Semantic Sensor Networks
Ingredients for Semantic Sensor NetworksIngredients for Semantic Sensor Networks
Ingredients for Semantic Sensor Networks
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - Irill
 
Future Of Technology
Future Of  TechnologyFuture Of  Technology
Future Of Technology
 
DEF CON 27 - BRENT STONE - reverse enginerring 17 cars
DEF CON 27 - BRENT STONE - reverse enginerring 17 carsDEF CON 27 - BRENT STONE - reverse enginerring 17 cars
DEF CON 27 - BRENT STONE - reverse enginerring 17 cars
 
Syst biol 2012-burguiere-sysbio sys069
Syst biol 2012-burguiere-sysbio sys069Syst biol 2012-burguiere-sysbio sys069
Syst biol 2012-burguiere-sysbio sys069
 
future-of-technology
future-of-technologyfuture-of-technology
future-of-technology
 
Lopez
LopezLopez
Lopez
 
A semantics based approach to malware detection
A semantics based approach to malware detectionA semantics based approach to malware detection
A semantics based approach to malware detection
 
CV - DCHATTERJI
CV - DCHATTERJICV - DCHATTERJI
CV - DCHATTERJI
 
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...
An Empirical Characterization of Software Bugs in Open-Source Cyber-Physical ...
 
36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure36x48_new_modelling_cloud_infrastructure
36x48_new_modelling_cloud_infrastructure
 
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...On the Relevance of Code Anomalies for Identifying Architecture Degradation S...
On the Relevance of Code Anomalies for Identifying Architecture Degradation S...
 
Yuri A. Ivanov
Yuri A. IvanovYuri A. Ivanov
Yuri A. Ivanov
 
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...
The Secret Recipe for Automating Android Malware Analysis - Lorenzo Cavallaro...
 
weaver_resume2
weaver_resume2weaver_resume2
weaver_resume2
 

More from Fabio Palomba

Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Does Refactoring of Test Smells Induce Fixing Flaky Tests?Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Does Refactoring of Test Smells Induce Fixing Flaky Tests?Fabio Palomba
 
Extract Package Refactoring in ARIES
Extract Package Refactoring in ARIESExtract Package Refactoring in ARIES
Extract Package Refactoring in ARIESFabio Palomba
 
Textual Analysis for Code Smell Detection
Textual Analysis for Code Smell DetectionTextual Analysis for Code Smell Detection
Textual Analysis for Code Smell DetectionFabio Palomba
 
Next! - An Android application to support tourists activities
Next! - An Android application to support tourists activitiesNext! - An Android application to support tourists activities
Next! - An Android application to support tourists activitiesFabio Palomba
 
A false digital alibi on Mac OS X
A false digital alibi on Mac OS XA false digital alibi on Mac OS X
A false digital alibi on Mac OS XFabio Palomba
 
Un plug-in Eclipse per il supporto all'Extract Class Refactoring
Un plug-in Eclipse per il supporto all'Extract Class RefactoringUn plug-in Eclipse per il supporto all'Extract Class Refactoring
Un plug-in Eclipse per il supporto all'Extract Class RefactoringFabio Palomba
 

More from Fabio Palomba (7)

Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Does Refactoring of Test Smells Induce Fixing Flaky Tests?Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Does Refactoring of Test Smells Induce Fixing Flaky Tests?
 
Extract Package Refactoring in ARIES
Extract Package Refactoring in ARIESExtract Package Refactoring in ARIES
Extract Package Refactoring in ARIES
 
Textual Analysis for Code Smell Detection
Textual Analysis for Code Smell DetectionTextual Analysis for Code Smell Detection
Textual Analysis for Code Smell Detection
 
People management
People managementPeople management
People management
 
Next! - An Android application to support tourists activities
Next! - An Android application to support tourists activitiesNext! - An Android application to support tourists activities
Next! - An Android application to support tourists activities
 
A false digital alibi on Mac OS X
A false digital alibi on Mac OS XA false digital alibi on Mac OS X
A false digital alibi on Mac OS X
 
Un plug-in Eclipse per il supporto all'Extract Class Refactoring
Un plug-in Eclipse per il supporto all'Extract Class RefactoringUn plug-in Eclipse per il supporto all'Extract Class Refactoring
Un plug-in Eclipse per il supporto all'Extract Class Refactoring
 

Recently uploaded

MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Recently uploaded (20)

MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 

Detecting Bad Smells in Source Code using Change History Information

  • 1. Fabio Palomba DETECTING BAD SMELLS IN SOURCE CODE USING CHANGE HISTORY INFORMATION Universityofsalerno fisciano,27/09/2013 Candidate: Fabio Palomba @fabiopalomba3 ADVISORS: Andrea De Lucia Gabriele Bavota sabato 28 settembre 13
  • 2. TODAY, I’LL SPEAK ABOUT... Bad Code: causes and effects Software Evolution and Code Quality HIST: Historical Information for Smell deTection A Method to Detect Bad Smells using Historical Informations sabato 28 settembre 13
  • 3. SOFTWARE EVOLUTION AND CODE QUALITY PART I sabato 28 settembre 13
  • 4. Cohesion Coupling W. Stevens, G. Myers, and L. Constantine. Structured design. IBM Systems Journal, 13(2):115 - 139, 1974. sabato 28 settembre 13
  • 6. Victor R. Basili, Lionel C. Briand, and Walcélio L. Melo.A validation of object- oriented design metrics as quality indicators. IEEETransactions on Software Engineering, 22(10):751 - 761, 1996. L. C. Briand, J.Wüst, J.W. Daly, andV. D. Porter. Exploring the relationship between design measures and software quality in object- oriented systems. Journal of Systems and Software (JSS), 51(3):245 - 273, 2000. DEFECTS sabato 28 settembre 13
  • 7. COMPREHENSIBILITY M.Abbes, F. Khomh,Y.-G. Guéhéneuc, and G.Antoniol,“An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension,” in 15th European Conference on Software Maintenance and Reengineering, CSMR 2011. sabato 28 settembre 13
  • 8. Tibor Gyimóthy, Rudolf Ferenc, and István Siket. Empirical validation of object- oriented metrics on open source software for fault prediction. IEEETransactions on Software Engineering (TSE), 31(10):897 - 910, 2005. PRODUCTIVITY sabato 28 settembre 13
  • 9. 2 - 100 MAINTENANCE COSTS ARE GREATER THAN DEVELOPMENT COSTS R.D. Banker, S. M. Datar, C. F. Kemerer, D. Zweig. Software complexity and maintenance costs. Communications of the ACM, v.36 n.11, pages 81 - 94, 1993. sabato 28 settembre 13
  • 11. An AntiPattern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences William H. Brown, Raphael C. Malveau, Hays W. McCormick,Thomas J. Mowbray - Antipatterns: Refactoring Software,Architectures and Project in Crisis 22 14 BAD SMELLS: DEFINITION DEVELOPMENT ANTIPATTERNSsabato 28 settembre 13
  • 12. DETECTION VIA STRUCTURAL ANALYSIS “Code smell are structural characteristics of software that may indicate a code or design problem.” F. Fontana et al. - “Automatic detection of bad smells in code:An experimental assessment”, Journal of ObjectTechnology sabato 28 settembre 13
  • 13. DETECTION VIA STRUCTURAL ANALYSIS “Code smell are structural characteristics of software that may indicate a code or design problem.” Many bad smells are intrinsically characterized by how code elements change over time, rather than by structural properties! F. Fontana et al. - “Automatic detection of bad smells in code:An experimental assessment”, Journal of ObjectTechnology sabato 28 settembre 13
  • 15. HIST PROCESS sabato 28 settembre 13
  • 16. HIST PROCESS sabato 28 settembre 13
  • 17. EXTRACTING CHANGE HISTORY Changes at method-level are captured using a code-analyzer developed in the Markos European Project* * http://markosproject.berlios.de sabato 28 settembre 13
  • 18. HIST PROCESS sabato 28 settembre 13
  • 19. HIST PROCESS sabato 28 settembre 13
  • 20. DETECTION ALGORITHMS Divergent change occurs when one class is commonly changed in different ways for different reasons. Classes having at least two sets of methods changing together but independently from methods in the other sets F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 21. DETECTION ALGORITHMS Divergent change occurs when one class is commonly changed in different ways for different reasons. Classes having at least two sets of methods changing together but independently from methods in the other sets F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 22. DETECTION ALGORITHMS Divergent change occurs when one class is commonly changed in different ways for different reasons. Classes having at least two sets of methods changing together but independently from methods in the other sets F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 23. MINING VERSION HISTORIES THROUGH ASSOCIATION RULE DISCOVERY C E D B A Files Changesoccurringinsnapshots S1 S2 S3 S4 S5 S6 S7 S8 Thomas Zimmermann, Peter Weißgerber, Stephan Diehl,Andreas Zeller: MiningVersion Histories to Guide Software Changes. ICSE 2004: 563-572 AnnieT.T.Ying, Gail C. Murphy, RaymondT. Ng, Mark Chu-Carroll: Predicting Source Code Changes by Mining Change History. IEEETrans. Software Eng. 30(9): 574-586 (2004) A C B D A D B D E A C B D E A C sabato 28 settembre 13
  • 24. MINING VERSION HISTORIES THROUGH ASSOCIATION RULE DISCOVERY C E D B A Files Changesoccurringinsnapshots S1 S2 S3 S4 S5 S6 S7 S8 Thomas Zimmermann, Peter Weißgerber, Stephan Diehl,Andreas Zeller: MiningVersion Histories to Guide Software Changes. ICSE 2004: 563-572 AnnieT.T.Ying, Gail C. Murphy, RaymondT. Ng, Mark Chu-Carroll: Predicting Source Code Changes by Mining Change History. IEEETrans. Software Eng. 30(9): 574-586 (2004) A C B D A D B D E A C B D E A C sabato 28 settembre 13
  • 25. Classes containing at least one method changing together with methods contained in more than δ(δ=3) different classes DETECTION ALGORITHMS You have a Shotgun Surgery when every time you make a kind of change, you have to make a lot of little changes to a lot of different classes. F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 26. Pairs of classes for which the addition of a subclass implies the addition of a subclass for the other class You have a Parallel Inheritance Hierarchies when every time you make a subclass of one class, you also have to make a subclass of another. DETECTION ALGORITHMS F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 27. DETECTION ALGORITHMS A Blob is a class implementing several responsibilities, having a large number of attributes, operations and dependencies with data classes. Classes modified (in any way) in more than α% (α =8) commits involving at least another class F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 28. DETECTION ALGORITHMS A Feature Envy occurs when a method is more interested in a class other than the one it is actually in. Methods involved in commits with methods of another class of the system β% (β =70) more than commits with methods of their class F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 30. CASE STUDY DESIGN RQ1:Which are the performance of HIST in detecting bad smells? RQ2: How does HIST compares to the techniques based on structural analysis? RQ System Metrics ApacheTomcat Apache Ant JEdit 5 API Android ApacheTomcat Apache Ant JEdit 5 API Android Precision Recall F-Measure Precision Recall F-Measure Correctti ∩ Correcttj Correctti Correcttj F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 sabato 28 settembre 13
  • 31. 10 % (20 - 7) 0 % (0 - 0) 7 % (4 - 45) 50 % (52 - 49) 63 % (68 - 60) 76 % (73 - 79) 89 % (80 - 100) 61 % (61 - 61) 68 % (76 - 61) 76 % (71 - 81) RESULTS Bad smell HIST Code analysis technique F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 Divergent Change Shotgun Surgery Parallel Inheritance Blob Feature Envy F-Measure (Precision - Recall) F-Measure (Precision - Recall) sabato 28 settembre 13
  • 32. 48 % 41 % 17 % 39 % 35 % 20 % 40 %43 % 17 % RESULTS F. Palomba, G. Bavota, M. Di Penta, R. Oliveto,A. De Lucia and D. Poshyvanyk,“Detecting Bad Smells in Source Code Using Change History Information”, in the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), 2013 0 % 93 % 100 %0 % 7 % 0 % Bad smell HIST ∩ CA HIST CA CA HIST Divergent Change Shotgun Surgery Parallel Inheritance Blob Feature Envy sabato 28 settembre 13
  • 33. Conclusions & Future work sabato 28 settembre 13
  • 34. CONCLUSION “This paper seems to bring some fresh air into an area that has not seen breakthroughs for some time.” [One of the ASE Reviewers] + PRECISION + F - MEASURE + RECALL + Historical analysis for smell detection - Historical information is needed sabato 28 settembre 13
  • 35. CAN WE DEFINE AN HYBRID APPROACH TO DETECT BAD SMELLS? sabato 28 settembre 13
  • 36. CAN WE USE HIST TO DETECT OTHER BAD SMELLS? Spaghetti Code Long Method Complex Class Refused Bequest Duplicate Code Primitive Obsession Middle Man Data Clump sabato 28 settembre 13
  • 37. Fabio Palomba fabiopalomba13 fabio.palomba.89@gmail.com http://www.linkedin.com/pub/fabio-palomba/4a/542/60 University of Salerno DETECTING BAD SMELLS IN SOURCE CODE USING CHANGE HISTORY INFORMATION Thank you! Questions and/or comments sabato 28 settembre 13