SlideShare a Scribd company logo
1 of 75
Download to read offline
Detecting and Removing Bad Code 
Smells from Source Code 
A review of my first PhD year 
Fabio Palomba 
PhD Symposium 2014
Technical Debt is... 
“Not quite right code which we 
postpone making it right.” 
W. Cunningham
Technical Debt is... 
“Not quite right code which we 
postpone making it right.” 
W. Cunningham 
Low Internal Quality 
Documentation Debt 
Coding Style Violation 
Code Smell 
Test debt 
Architectural Debt Structural Debt 
Code Complexity
Bad Code Smells
[Abbes et al. CSMR 2011]
[Abbes et al. CSMR 2011] 
Bad Smells hinder code 
comprehensibility
[Khomh et al. EMSE 2012]
[Khomh et al. EMSE 2012] 
Bad Smells increase change 
and fault proneness
[Banker et al. Comm. of the ACM 1993]
[Banker et al. Comm. of the ACM 1993] 
Bad smells increase 
maintenance costs
F. Palomba, A. De Lucia, G. Bavota, R. Oliveto. 
“Anti-Pattern Detection: Methods, Challanges, and Open Issues” 
Advances in Computers, vol. 95 (to appear)
Many detection techniques 
use structural analysis
Many bad smells are intrinsically characterized 
by how code elements change over time, rather 
than by structural properties
HIST 
Historical Information 
for Smell deTection
HIST 
Historical Information 
for Smell deTection
HISTChange History Extractor 
Historical Information 
for Smell deTection
HISTChange History Extractor 
log download 
Historical Information 
for Smell deTection
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved 
class 
User 
has been 
added
HISTChange History Extractor 
log download code analyzer 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved 
class 
User 
has been 
added 
... 
... 
... 
...
HISTChange History Extractor 
log download code analyzer 
Code Smells Detector 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved 
class 
User 
has been 
added 
... 
... 
... 
...
HISTChange History Extractor 
log download code analyzer 
Code Smells Detector 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved 
class 
User 
has been 
added 
... 
... 
... 
... 
Association rule 
discovery to capture co-changes 
between entities
HISTChange History Extractor 
log download code analyzer 
Code Smells Detector 
Historical Information 
for Smell deTection 
method 
getUser 
has been 
added 
method 
getData 
has been 
modified 
method 
getLogin 
has been 
moved 
class 
User 
has been 
added 
... 
... 
... 
... 
Association rule 
discovery to capture co-changes 
between entities 
Analysis of change 
frequency of some 
specific entities
HISTCode Smell Detector 
Five different smells considered 
Divergent Change 
Shotugun Surgery 
Parallel Inheritance 
Historical Information 
for Smell deTection
HISTCode Smell Detector 
Five different smells considered 
Three code smells, by definition, 
to consider as “historical” smells 
Divergent Change 
Shotugun Surgery 
Parallel Inheritance 
Historical Information 
for Smell deTection
HISTCode Smell Detector 
Five different smells considered 
Three code smells, by definition, 
to consider as “historical” smells 
Divergent Change 
Shotugun Surgery 
Parallel Inheritance 
Blob 
Feature Envy 
Historical Information 
for Smell deTection
HISTCode Smell Detector 
Five different smells considered 
Three code smells, by definition, 
to consider as “historical” smells 
Divergent Change 
Shotugun Surgery 
Parallel Inheritance 
Two code smells generally 
detected by structural analysis, 
where the historical analysis can 
aid in the identification of 
complementary information 
Blob 
Feature Envy 
Historical Information 
for Smell deTection
Code Smells Detector 
divergent change
Code Smells Detector 
divergent change 
A class is changed in different 
ways for different reasons
Code Smells Detector 
divergent change 
A class is changed in different 
ways for different reasons 
Solution: 
Extract Class Refactoring
Code Smells Detector 
divergent change 
A class is changed in different 
ways for different reasons 
Solution: 
Extract Class Refactoring 
Detection 
Classes containing at least two sets of methods 
such that: 
(i) all methods in the set change together as 
detected by the association rules 
(ii) each method in the set does not change with 
methods in other sets
Code Smells Detector 
blob
Code Smells Detector 
blob 
A class implementing several 
responsibilities, having a large size, 
and dependencies with data classes
Code Smells Detector 
blob 
A class implementing several 
responsibilities, having a large size, 
and dependencies with data classes 
Solution: 
Extract Class refactoring
Code Smells Detector 
blob 
A class implementing several 
responsibilities, having a large size, 
and dependencies with data classes 
Solution: 
Extract Class refactoring 
Detection 
Blobs are identified as classes frequently modified in 
commits involving at least another class. 
t1 t2 t3 t4 t5 t6 t7 t8 t9
Evaluation 
detection accuracy
Evaluation 
detection accuracy 
20 open source 
systems
Evaluation 
detection accuracy 
Comparing HIST with static code 
analysis technique on a manually 
built oracle 
20 open source 
systems
Evaluation 
detection accuracy 
20 open source 
systems 
Shotgun Surgery 
Parallel Inheritance 
Divergent Change 
Blob 
Feature Envy 
Comparing HIST with static code 
analysis technique on a manually 
built oracle 
HIST F-Measure CA technique F-Measure 
92% 
71% 
82% 
64% 
77% 
0% 
9% 
11% 
48% 
68%
Evaluation 
detection accuracy 
Comparing HIST with static code 
analysis technique on a manually 
built oracle 
HIST and 
the CA techniques 
20 open source 
systems 
are highly complementary
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” - Distinguished Paper Award 
International Conference on Automated Software Engineering (ASE 2013)
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” - Distinguished Paper Award 
International Conference on Automated Software Engineering (ASE 2013)
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk and A. De Lucia. 
“Mining Version Histories for Detecting Code Smells” 
Transactions on Software Engineering (TSE) - 2015
http://www.sesa.unisa.it/landfill 
F. Palomba, D. Di Nucci, M. Tufano, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk and A. De Lucia. 
“Landfill: an Open Dataset of Code Smells with Public Evaluation” 
Submitted to the International Conference on Software Engineering (ICSE 2015)
HIST 
Mar 
16 The tool is coming soon... 
Historical Information 
for Smell deTection
Do They Really Smell Bad? 
A Study on Developers’ Perception of 
Bad Code Smells 
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, 
Rocco Oliveto, Andrea De Lucia 
ICSME 2014 
Victoria - Canada 
October 1st, 2014
“We don’t see things as they are, 
we see things as we are” 
Anais Nin
Investigating the 
developers’ point of view
RQ1: To what extent do bad smells reflect developers‘ 
perception of design problems? 
Investigating the 
developers’ point of view
RQ1: To what extent do bad smells reflect developers‘ 
perception of design problems? 
RQ2: What are the bad smells that developers feel 
as the most harmful? 
Investigating the 
developers’ point of view
Smells generally not Perceived as 
Design or Implementation Problems 
THEORical 
problems
Smells generally Perceived and 
Identified by Respondents 
THEY SHOULD BE 
CAREFULLY ANALYZED
Smells whose Perception may Var y 
dependently by Their Intensit y 
THEY SHOULD BE 
studied more
On the Innate Relationship between 
Quality and Refactoring
Refactoring is... 
“Refactoring is a disciplined technique for restructuring an 
existing body of code, improving its non-functional 
attributes without changing its external behavior.”
3 open source 
systems 
Studying if quality metrics 
/ bad smells capture 
refactoring operations
3 open source 
systems 
11 quality metrics 
Studying if quality metrics 
/ bad smells capture 
refactoring operations
3 open source 
systems 
11 quality metrics 
11 bad smells 
Studying if quality metrics 
/ bad smells capture 
refactoring operations
3 open source 
systems 
11 quality metrics 
11 bad smells 
12,922 refactoring operations 
manually validated 
Studying if quality metrics 
/ bad smells capture 
refactoring operations
G. Bavota, A. De Lucia, M. Di Penta, R. Oliveto and F. Palomba. 
“An Experimental Investigation on the Innate Relationship between Quality and Refactoring” 
Submitted to Transactions on Software Engineering and Methodology (TOSEM)
http://www.sesa.unisa.it/tools/aries.jsp 
F. Palomba, M. Tufano, G. Bavota, R. Oliveto, A. Marcus, D. Poshyvanyk, and A. De Lucia. 
“Extract Package Refactoring in ARIES” 
Submitted to the International Conference on Software Engineering (ICSE 2015)
Moving Forward
M. Tufano, F. Palomba, G. Bavota, R. Oliveto, M. Di Penta, A. De Lucia, and D. Poshyvanyk 
“When and Why Your Code Starts to Smell Bad” 
Submitted to the International Conference on Software Engineering (ICSE 2015)
F. Palomba 
“Textual Analysis for Code Smell Detection” 
Submitted to the International Conference on Software Engineering (ICSE 2015)
Learning from the past for 
prioritizing bad code smells
Technical Debt is... 
“Not quite right code which we 
postpone making it right.” 
W. Cunningham 
Low Internal Quality 
Documentation Debt 
Coding Style Violation 
Code Smell 
Test debt 
Architectural Debt Structural Debt 
Code Complexity
Fabio Palomba 
fpalomba.unisa.it 
dibt.unimol.it/fpalomba 
Research is 
a work of

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
 
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
 
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
 
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
 
MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
MAVIS: A Visualization Tool for Cohesion-based Bad Smell InspectionMAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection立偉 馬
 
Plagiarism introduction
Plagiarism introductionPlagiarism introduction
Plagiarism introductionMerin Paul
 

What's hot (7)

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
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
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
 
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
 
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
 
MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
MAVIS: A Visualization Tool for Cohesion-based Bad Smell InspectionMAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
MAVIS: A Visualization Tool for Cohesion-based Bad Smell Inspection
 
Plagiarism introduction
Plagiarism introductionPlagiarism introduction
Plagiarism introduction
 

Viewers also liked

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
 
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
 
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
 
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
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?Tushar Sharma
 
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbRuby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbKoichiro Sumi
 

Viewers also liked (10)

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)
 
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
 
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
 
Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?
 
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
 
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorbRuby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
 
MSR 2015 Announcement
MSR 2015 AnnouncementMSR 2015 Announcement
MSR 2015 Announcement
 

Similar to PhD Symposium 2014

Biocatalogue Talk Slides
Biocatalogue Talk SlidesBiocatalogue Talk Slides
Biocatalogue Talk SlidesBioCatalogue
 
A survey on software smells
A survey on software smellsA survey on software smells
A survey on software smellsZahid Qaisar
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringAli Ouni
 
2014 Taverna Tutorial Introduction to eScience and workflows
2014 Taverna Tutorial Introduction to eScience and workflows2014 Taverna Tutorial Introduction to eScience and workflows
2014 Taverna Tutorial Introduction to eScience and workflowsmyGrid team
 
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...ijcnes
 
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...SEAA 2022
 
Resilience Engineering: A field of study, a community, and some perspective s...
Resilience Engineering: A field of study, a community, and some perspective s...Resilience Engineering: A field of study, a community, and some perspective s...
Resilience Engineering: A field of study, a community, and some perspective s...John Allspaw
 
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...amiable_indian
 
Getting Serious About A Community Bio Service Catalogue
Getting Serious About A Community Bio Service CatalogueGetting Serious About A Community Bio Service Catalogue
Getting Serious About A Community Bio Service CatalogueBioCatalogue
 
Enhancing the Quality of ImmPort Data
Enhancing the Quality of ImmPort DataEnhancing the Quality of ImmPort Data
Enhancing the Quality of ImmPort DataBarry Smith
 
Improving the accuracy of fingerprinting system using multibiometric approach
Improving the accuracy of fingerprinting system using multibiometric approachImproving the accuracy of fingerprinting system using multibiometric approach
Improving the accuracy of fingerprinting system using multibiometric approachIJERA Editor
 
Incident Response Tactics with Compromise Indicators
Incident Response Tactics with Compromise IndicatorsIncident Response Tactics with Compromise Indicators
Incident Response Tactics with Compromise IndicatorsF _
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringTao Xie
 
Critical analysis of radar data signal de noising by implementation of haar w...
Critical analysis of radar data signal de noising by implementation of haar w...Critical analysis of radar data signal de noising by implementation of haar w...
Critical analysis of radar data signal de noising by implementation of haar w...eSAT Journals
 
#iCanHazRobot?: improved robot detection for IR usage statistics
#iCanHazRobot?: improved robot detection for IR usage statistics#iCanHazRobot?: improved robot detection for IR usage statistics
#iCanHazRobot?: improved robot detection for IR usage statisticsUCD Library
 

Similar to PhD Symposium 2014 (20)

Biocatalogue Talk Slides
Biocatalogue Talk SlidesBiocatalogue Talk Slides
Biocatalogue Talk Slides
 
A survey on software smells
A survey on software smellsA survey on software smells
A survey on software smells
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software Enginnering
 
Of Changes and Their History
Of Changes and Their HistoryOf Changes and Their History
Of Changes and Their History
 
2014 Taverna Tutorial Introduction to eScience and workflows
2014 Taverna Tutorial Introduction to eScience and workflows2014 Taverna Tutorial Introduction to eScience and workflows
2014 Taverna Tutorial Introduction to eScience and workflows
 
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
 
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
 
Resilience Engineering: A field of study, a community, and some perspective s...
Resilience Engineering: A field of study, a community, and some perspective s...Resilience Engineering: A field of study, a community, and some perspective s...
Resilience Engineering: A field of study, a community, and some perspective s...
 
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
 
Getting Serious About A Community Bio Service Catalogue
Getting Serious About A Community Bio Service CatalogueGetting Serious About A Community Bio Service Catalogue
Getting Serious About A Community Bio Service Catalogue
 
Enhancing the Quality of ImmPort Data
Enhancing the Quality of ImmPort DataEnhancing the Quality of ImmPort Data
Enhancing the Quality of ImmPort Data
 
ChemSpider - Does Community Engagement work to Build a Quality Online Resourc...
ChemSpider - Does Community Engagement work to Build a Quality Online Resourc...ChemSpider - Does Community Engagement work to Build a Quality Online Resourc...
ChemSpider - Does Community Engagement work to Build a Quality Online Resourc...
 
Improving the accuracy of fingerprinting system using multibiometric approach
Improving the accuracy of fingerprinting system using multibiometric approachImproving the accuracy of fingerprinting system using multibiometric approach
Improving the accuracy of fingerprinting system using multibiometric approach
 
DCC Keynote 2007
DCC Keynote 2007DCC Keynote 2007
DCC Keynote 2007
 
Incident Response Tactics with Compromise Indicators
Incident Response Tactics with Compromise IndicatorsIncident Response Tactics with Compromise Indicators
Incident Response Tactics with Compromise Indicators
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Variant analysis and whole exome sequencing
Variant analysis and whole exome sequencingVariant analysis and whole exome sequencing
Variant analysis and whole exome sequencing
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
 
Critical analysis of radar data signal de noising by implementation of haar w...
Critical analysis of radar data signal de noising by implementation of haar w...Critical analysis of radar data signal de noising by implementation of haar w...
Critical analysis of radar data signal de noising by implementation of haar w...
 
#iCanHazRobot?: improved robot detection for IR usage statistics
#iCanHazRobot?: improved robot detection for IR usage statistics#iCanHazRobot?: improved robot detection for IR usage statistics
#iCanHazRobot?: improved robot detection for IR usage statistics
 

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

OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 

Recently uploaded (20)

OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 

PhD Symposium 2014

  • 1. Detecting and Removing Bad Code Smells from Source Code A review of my first PhD year Fabio Palomba PhD Symposium 2014
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Technical Debt is... “Not quite right code which we postpone making it right.” W. Cunningham
  • 7. Technical Debt is... “Not quite right code which we postpone making it right.” W. Cunningham Low Internal Quality Documentation Debt Coding Style Violation Code Smell Test debt Architectural Debt Structural Debt Code Complexity
  • 9.
  • 10. [Abbes et al. CSMR 2011]
  • 11. [Abbes et al. CSMR 2011] Bad Smells hinder code comprehensibility
  • 12. [Khomh et al. EMSE 2012]
  • 13. [Khomh et al. EMSE 2012] Bad Smells increase change and fault proneness
  • 14. [Banker et al. Comm. of the ACM 1993]
  • 15. [Banker et al. Comm. of the ACM 1993] Bad smells increase maintenance costs
  • 16. F. Palomba, A. De Lucia, G. Bavota, R. Oliveto. “Anti-Pattern Detection: Methods, Challanges, and Open Issues” Advances in Computers, vol. 95 (to appear)
  • 17. Many detection techniques use structural analysis
  • 18. Many bad smells are intrinsically characterized by how code elements change over time, rather than by structural properties
  • 19. HIST Historical Information for Smell deTection
  • 20. HIST Historical Information for Smell deTection
  • 21. HISTChange History Extractor Historical Information for Smell deTection
  • 22. HISTChange History Extractor log download Historical Information for Smell deTection
  • 23. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection
  • 24. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection method getUser has been added
  • 25. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection method getUser has been added method getData has been modified
  • 26. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved
  • 27. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved class User has been added
  • 28. HISTChange History Extractor log download code analyzer Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved class User has been added ... ... ... ...
  • 29. HISTChange History Extractor log download code analyzer Code Smells Detector Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved class User has been added ... ... ... ...
  • 30. HISTChange History Extractor log download code analyzer Code Smells Detector Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved class User has been added ... ... ... ... Association rule discovery to capture co-changes between entities
  • 31. HISTChange History Extractor log download code analyzer Code Smells Detector Historical Information for Smell deTection method getUser has been added method getData has been modified method getLogin has been moved class User has been added ... ... ... ... Association rule discovery to capture co-changes between entities Analysis of change frequency of some specific entities
  • 32. HISTCode Smell Detector Five different smells considered Divergent Change Shotugun Surgery Parallel Inheritance Historical Information for Smell deTection
  • 33. HISTCode Smell Detector Five different smells considered Three code smells, by definition, to consider as “historical” smells Divergent Change Shotugun Surgery Parallel Inheritance Historical Information for Smell deTection
  • 34. HISTCode Smell Detector Five different smells considered Three code smells, by definition, to consider as “historical” smells Divergent Change Shotugun Surgery Parallel Inheritance Blob Feature Envy Historical Information for Smell deTection
  • 35. HISTCode Smell Detector Five different smells considered Three code smells, by definition, to consider as “historical” smells Divergent Change Shotugun Surgery Parallel Inheritance Two code smells generally detected by structural analysis, where the historical analysis can aid in the identification of complementary information Blob Feature Envy Historical Information for Smell deTection
  • 36. Code Smells Detector divergent change
  • 37. Code Smells Detector divergent change A class is changed in different ways for different reasons
  • 38. Code Smells Detector divergent change A class is changed in different ways for different reasons Solution: Extract Class Refactoring
  • 39. Code Smells Detector divergent change A class is changed in different ways for different reasons Solution: Extract Class Refactoring Detection Classes containing at least two sets of methods such that: (i) all methods in the set change together as detected by the association rules (ii) each method in the set does not change with methods in other sets
  • 41. Code Smells Detector blob A class implementing several responsibilities, having a large size, and dependencies with data classes
  • 42. Code Smells Detector blob A class implementing several responsibilities, having a large size, and dependencies with data classes Solution: Extract Class refactoring
  • 43. Code Smells Detector blob A class implementing several responsibilities, having a large size, and dependencies with data classes Solution: Extract Class refactoring Detection Blobs are identified as classes frequently modified in commits involving at least another class. t1 t2 t3 t4 t5 t6 t7 t8 t9
  • 45. Evaluation detection accuracy 20 open source systems
  • 46. Evaluation detection accuracy Comparing HIST with static code analysis technique on a manually built oracle 20 open source systems
  • 47. Evaluation detection accuracy 20 open source systems Shotgun Surgery Parallel Inheritance Divergent Change Blob Feature Envy Comparing HIST with static code analysis technique on a manually built oracle HIST F-Measure CA technique F-Measure 92% 71% 82% 64% 77% 0% 9% 11% 48% 68%
  • 48. Evaluation detection accuracy Comparing HIST with static code analysis technique on a manually built oracle HIST and the CA techniques 20 open source systems are highly complementary
  • 49. 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” - Distinguished Paper Award International Conference on Automated Software Engineering (ASE 2013)
  • 50. 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” - Distinguished Paper Award International Conference on Automated Software Engineering (ASE 2013)
  • 51. F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk and A. De Lucia. “Mining Version Histories for Detecting Code Smells” Transactions on Software Engineering (TSE) - 2015
  • 52. http://www.sesa.unisa.it/landfill F. Palomba, D. Di Nucci, M. Tufano, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk and A. De Lucia. “Landfill: an Open Dataset of Code Smells with Public Evaluation” Submitted to the International Conference on Software Engineering (ICSE 2015)
  • 53. HIST Mar 16 The tool is coming soon... Historical Information for Smell deTection
  • 54. Do They Really Smell Bad? A Study on Developers’ Perception of Bad Code Smells Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, Andrea De Lucia ICSME 2014 Victoria - Canada October 1st, 2014
  • 55. “We don’t see things as they are, we see things as we are” Anais Nin
  • 57. RQ1: To what extent do bad smells reflect developers‘ perception of design problems? Investigating the developers’ point of view
  • 58. RQ1: To what extent do bad smells reflect developers‘ perception of design problems? RQ2: What are the bad smells that developers feel as the most harmful? Investigating the developers’ point of view
  • 59. Smells generally not Perceived as Design or Implementation Problems THEORical problems
  • 60. Smells generally Perceived and Identified by Respondents THEY SHOULD BE CAREFULLY ANALYZED
  • 61. Smells whose Perception may Var y dependently by Their Intensit y THEY SHOULD BE studied more
  • 62. On the Innate Relationship between Quality and Refactoring
  • 63. Refactoring is... “Refactoring is a disciplined technique for restructuring an existing body of code, improving its non-functional attributes without changing its external behavior.”
  • 64. 3 open source systems Studying if quality metrics / bad smells capture refactoring operations
  • 65. 3 open source systems 11 quality metrics Studying if quality metrics / bad smells capture refactoring operations
  • 66. 3 open source systems 11 quality metrics 11 bad smells Studying if quality metrics / bad smells capture refactoring operations
  • 67. 3 open source systems 11 quality metrics 11 bad smells 12,922 refactoring operations manually validated Studying if quality metrics / bad smells capture refactoring operations
  • 68. G. Bavota, A. De Lucia, M. Di Penta, R. Oliveto and F. Palomba. “An Experimental Investigation on the Innate Relationship between Quality and Refactoring” Submitted to Transactions on Software Engineering and Methodology (TOSEM)
  • 69. http://www.sesa.unisa.it/tools/aries.jsp F. Palomba, M. Tufano, G. Bavota, R. Oliveto, A. Marcus, D. Poshyvanyk, and A. De Lucia. “Extract Package Refactoring in ARIES” Submitted to the International Conference on Software Engineering (ICSE 2015)
  • 71. M. Tufano, F. Palomba, G. Bavota, R. Oliveto, M. Di Penta, A. De Lucia, and D. Poshyvanyk “When and Why Your Code Starts to Smell Bad” Submitted to the International Conference on Software Engineering (ICSE 2015)
  • 72. F. Palomba “Textual Analysis for Code Smell Detection” Submitted to the International Conference on Software Engineering (ICSE 2015)
  • 73. Learning from the past for prioritizing bad code smells
  • 74. Technical Debt is... “Not quite right code which we postpone making it right.” W. Cunningham Low Internal Quality Documentation Debt Coding Style Violation Code Smell Test debt Architectural Debt Structural Debt Code Complexity
  • 75. Fabio Palomba fpalomba.unisa.it dibt.unimol.it/fpalomba Research is a work of