SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 
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...University of Hawai‘i at Mānoa
 
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
 

Tendances (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...
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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