SlideShare a Scribd company logo
Textual Analysis for Code
Smell Detection
FA B I O PA L O M B A , U N I V E R S I T Y O F S A L E R N O
D I B T. U N I M O L . I T / F PA L O M B A
I C S E 2 0 1 5 S R C
M AY 2 2 , 2 0 1 5
F L O R E N C E , I TA LY
C O D E S M E L L S A R E
S Y M P T O M S O F P O O R
D E S I G N O R
I M P L E M E N TAT I O N C H O I S E S
Code Smell
[Martin Fowler]
C O D E S M E L L S A R E M O R E
C H A N G E - A N D FA U LT-
P R O N E N E S S
C O D E S M E L L S I N C R E A S E S
M A I N T E N A N C E C O S T S
Khomh et. al - EMSE 2012
Banker et. al - Communications of
the ACM 1993
C O D E S M E L L S
H I N D E R
C O M P R E H E N S I B I L I T Y
Abbes et. al - CSMR 2011
S E V E R A L A P P ROAC H E S H AV E B E E N P RO P O S E D, E X P L O I T I N G
D I F F E R E N T K I N D O F I N F O R M AT I O N
S T R U C T U R A L
I N F O R M AT I O N
H I S T O R I C A L
A N A LY S I S
I S I T P O S S I B L E T O D E T E C T S M E L L S U S I N G
C O N C E P T U A L I N F O R M AT I O N
?The Third Dimension
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
TACO - Textual Analysis for Code Smell Detection
“A Long Method as a method in which there is the implementation
of a main functionality together with auxiliary functions that should
be managed in different methods.”
[Martin Fowler]
TACO - Textual Analysis for Code Smell Detection
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
method mi
method mi
method blocks
extract
blocks
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
TACO - Textual Analysis for Code Smell Detection
method blocks
pruned method blocks
extract
identifiers
extract
comments
extract
blocks
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
TACO - Textual Analysis for Code Smell Detection
method mi
similarity matrix
method blocks
pruned method blocks
compute
similarity
extract
identifiers
extract
comments
extract
blocks
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
TACO - Textual Analysis for Code Smell Detection
method mi
similarity matrix
method blocks
pruned method blocks
compute
similarity
extract
identifiers
extract
comments
I F E X I S T B L O C K S W I T H S I M I L A R I T Y <
T H E N A L O N G M E T H O D I S D E T E C T E D
extract
blocks
t
T H E C A S E O F L O N G M E T H O D D E T E C T I O N
TACO - Textual Analysis for Code Smell Detection
method m
T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
TACO - Textual Analysis for Code Smell Detection
Apache Cassandra
Apache Xerces
Eclipse Core
TACO - Textual Analysis for Code Smell Detection
Apache Cassandra
Apache Xerces
Eclipse Core
Precision
Recall
F-Measure
T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
TACO - Textual Analysis for Code Smell Detection
Apache Cassandra
Apache Xerces
Eclipse Core
Precision
Recall
F-Measure
Compared with
DECOR approach
[Moha et al.]
T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
TACO - Textual Analysis for Code Smell Detection
Apache Cassandra
Apache Xerces
Eclipse Core
Precision
Recall
F-Measure
Compared with
DECOR approach
[Moha et al.]
T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
63%
51%
DECOR
TACO
OVERALL F-MEASURE
OVERALL F-MEASURE
TACO - Textual Analysis for Code Smell Detection
Apache Cassandra
Apache Xerces
Eclipse Core
Precision
Recall
F-Measure
Compared with
DECOR approach
[Moha et al.]
TACO is highly complementary with
respect to DECOR on 2 systems analyzed
T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
63%
51%
DECOR
TACO
OVERALL F-MEASURE
OVERALL F-MEASURE
A P R AT I C A L E X A M P L E
TACO - Textual Analysis for Code Smell Detection
Method: findTypesAndPackages()
Goal: Discover the classes and the packages of a given project
Class: CompletionEngine - Eclipse Core
TACO - Textual Analysis for Code Smell Detection
Method: findTypesAndPackages()
Goal: Discover the classes and the packages of a given project
This method has
65 lines of code
Class: CompletionEngine - Eclipse Core
A P R AT I C A L E X A M P L E
TACO - Textual Analysis for Code Smell Detection
Method: findTypesAndPackages()
Goal: Discover the classes and the packages of a given project
This method has
65 lines of code
A S TAT I C A P P R O A C H C A N N O T
D E T E C T A L O N G M E T H O D
Class: CompletionEngine - Eclipse Core
A P R AT I C A L E X A M P L E
TACO - Textual Analysis for Code Smell Detection
Class: CompletionEngine - Eclipse Core
Method: findTypesAndPackages()
Goal: Discover the classes and the packages of a given project
This method has
65 lines of code
A S TAT I C A P P R O A C H C A N N O T
D E T E C T A L O N G M E T H O D
But the method manages
more than one responsibility
I T A C T U A L LY
I S A L O N G M E T H O D !
A P R AT I C A L E X A M P L E
I S I T P O S S I B L E T O D E T E C T S M E L L S U S I N G
C O N C E P T U A L I N F O R M AT I O N
!The Third Dimension
YES, IT IS
S U M M A R I Z I N G
TACO - Textual Analysis for Code Smell Detection
Textual Analysis is useful for
smell detection
Textual Analysis is useful for
smell detection
Is TACO suitable for detectingother smells?
TACO - Textual Analysis for Code Smell Detection
What about a hybrid technique for
detecting smells?
C O M I N G S O O N …
Textual Analysis for Code
Smell Detection
FA B I O PA L O M B A , U N I V E R S I T Y O F S A L E R N O
D I B T. U N I M O L . I T / F PA L O M B A
I C S E 2 0 1 5 S R C
M AY 2 2 , 2 0 1 5
F L O R E N C E , I TA LY

More Related Content

Similar to Textual Analysis for Code Smell Detection (20)

PDF
Finding Bad Code Smells with Neural Network Models
IJECEIAES
 
PDF
A preliminary study on using code smells to improve bug localization
krws
 
PDF
A survey on software smells
Zahid Qaisar
 
DOCX
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
ijcnes
 
PDF
Msr17a.ppt
Yann-Gaël Guéhéneuc
 
PDF
Msr17a.ppt
Ptidej Team
 
DOCX
Synopsis minor project
Nidhi Chauhan
 
PDF
Synopsis ( Code Smells)
DeepAnshu Sharma
 
PDF
Test Anti-Patterns: From Definition to Detection
University of Hawai‘i at Mānoa
 
PDF
Master project - Competitive Co-evolutionary Code-Smells Detection
Mohamed BOUSSAA
 
PDF
Recommending Software Refactoring Using Search-based Software Enginnering
Ali Ouni
 
PPTX
When, why and for whom do practitioners detect technical debts?: An experienc...
Norihiro Yoshida
 
PPTX
Code Smell, Software Engineering
Anshul Vinayak
 
PPTX
Software Craftsmanship - 2
Uri Lavi
 
PPTX
Pre-Synopsis Presentation
DeepAnshu Sharma
 
PDF
Fase08.ppt
Yann-Gaël Guéhéneuc
 
PDF
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
Kamiya Toshihiro
 
PDF
Not Only Statements: The Role of Textual Analysis in Software Quality
Rocco Oliveto
 
PPTX
Code smell overview
Pham Manh Lan
 
Finding Bad Code Smells with Neural Network Models
IJECEIAES
 
A preliminary study on using code smells to improve bug localization
krws
 
A survey on software smells
Zahid Qaisar
 
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
ijcnes
 
Msr17a.ppt
Ptidej Team
 
Synopsis minor project
Nidhi Chauhan
 
Synopsis ( Code Smells)
DeepAnshu Sharma
 
Test Anti-Patterns: From Definition to Detection
University of Hawai‘i at Mānoa
 
Master project - Competitive Co-evolutionary Code-Smells Detection
Mohamed BOUSSAA
 
Recommending Software Refactoring Using Search-based Software Enginnering
Ali Ouni
 
When, why and for whom do practitioners detect technical debts?: An experienc...
Norihiro Yoshida
 
Code Smell, Software Engineering
Anshul Vinayak
 
Software Craftsmanship - 2
Uri Lavi
 
Pre-Synopsis Presentation
DeepAnshu Sharma
 
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
Kamiya Toshihiro
 
Not Only Statements: The Role of Textual Analysis in Software Quality
Rocco Oliveto
 
Code smell overview
Pham Manh Lan
 

More from Fabio Palomba (12)

PDF
Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Fabio Palomba
 
PDF
Social Debt Analytics for Improving the Management of Software Evolution Tasks
Fabio Palomba
 
PDF
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Fabio Palomba
 
PDF
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
Fabio Palomba
 
PDF
Extract Package Refactoring in ARIES
Fabio Palomba
 
PDF
ARIES: An Eclipse Plug-in To Support Extract Class Refactoring
Fabio Palomba
 
PDF
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Fabio Palomba
 
PDF
People management
Fabio Palomba
 
PDF
Next! - An Android application to support tourists activities
Fabio Palomba
 
PDF
Detecting Bad Smells in Source Code using Change History Information
Fabio Palomba
 
PDF
A false digital alibi on Mac OS X
Fabio Palomba
 
PDF
Un plug-in Eclipse per il supporto all'Extract Class Refactoring
Fabio Palomba
 
Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Fabio Palomba
 
Social Debt Analytics for Improving the Management of Software Evolution Tasks
Fabio Palomba
 
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Fabio Palomba
 
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
Fabio Palomba
 
Extract Package Refactoring in ARIES
Fabio Palomba
 
ARIES: An Eclipse Plug-in To Support Extract Class Refactoring
Fabio Palomba
 
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Fabio Palomba
 
People management
Fabio Palomba
 
Next! - An Android application to support tourists activities
Fabio Palomba
 
Detecting Bad Smells in Source Code using Change History Information
Fabio Palomba
 
A false digital alibi on Mac OS X
Fabio Palomba
 
Un plug-in Eclipse per il supporto all'Extract Class Refactoring
Fabio Palomba
 
Ad

Recently uploaded (20)

PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Ad

Textual Analysis for Code Smell Detection

  • 1. Textual Analysis for Code Smell Detection FA B I O PA L O M B A , U N I V E R S I T Y O F S A L E R N O D I B T. U N I M O L . I T / F PA L O M B A I C S E 2 0 1 5 S R C M AY 2 2 , 2 0 1 5 F L O R E N C E , I TA LY
  • 2. C O D E S M E L L S A R E S Y M P T O M S O F P O O R D E S I G N O R I M P L E M E N TAT I O N C H O I S E S Code Smell [Martin Fowler]
  • 3. C O D E S M E L L S A R E M O R E C H A N G E - A N D FA U LT- P R O N E N E S S C O D E S M E L L S I N C R E A S E S M A I N T E N A N C E C O S T S Khomh et. al - EMSE 2012 Banker et. al - Communications of the ACM 1993 C O D E S M E L L S H I N D E R C O M P R E H E N S I B I L I T Y Abbes et. al - CSMR 2011
  • 4. S E V E R A L A P P ROAC H E S H AV E B E E N P RO P O S E D, E X P L O I T I N G D I F F E R E N T K I N D O F I N F O R M AT I O N S T R U C T U R A L I N F O R M AT I O N H I S T O R I C A L A N A LY S I S
  • 5. I S I T P O S S I B L E T O D E T E C T S M E L L S U S I N G C O N C E P T U A L I N F O R M AT I O N ?The Third Dimension
  • 6. T H E C A S E O F L O N G M E T H O D D E T E C T I O N TACO - Textual Analysis for Code Smell Detection “A Long Method as a method in which there is the implementation of a main functionality together with auxiliary functions that should be managed in different methods.” [Martin Fowler]
  • 7. TACO - Textual Analysis for Code Smell Detection T H E C A S E O F L O N G M E T H O D D E T E C T I O N method mi
  • 8. method mi method blocks extract blocks T H E C A S E O F L O N G M E T H O D D E T E C T I O N TACO - Textual Analysis for Code Smell Detection
  • 9. method blocks pruned method blocks extract identifiers extract comments extract blocks T H E C A S E O F L O N G M E T H O D D E T E C T I O N TACO - Textual Analysis for Code Smell Detection method mi
  • 10. similarity matrix method blocks pruned method blocks compute similarity extract identifiers extract comments extract blocks T H E C A S E O F L O N G M E T H O D D E T E C T I O N TACO - Textual Analysis for Code Smell Detection method mi
  • 11. similarity matrix method blocks pruned method blocks compute similarity extract identifiers extract comments I F E X I S T B L O C K S W I T H S I M I L A R I T Y < T H E N A L O N G M E T H O D I S D E T E C T E D extract blocks t T H E C A S E O F L O N G M E T H O D D E T E C T I O N TACO - Textual Analysis for Code Smell Detection method m
  • 12. T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y TACO - Textual Analysis for Code Smell Detection Apache Cassandra Apache Xerces Eclipse Core
  • 13. TACO - Textual Analysis for Code Smell Detection Apache Cassandra Apache Xerces Eclipse Core Precision Recall F-Measure T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
  • 14. TACO - Textual Analysis for Code Smell Detection Apache Cassandra Apache Xerces Eclipse Core Precision Recall F-Measure Compared with DECOR approach [Moha et al.] T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y
  • 15. TACO - Textual Analysis for Code Smell Detection Apache Cassandra Apache Xerces Eclipse Core Precision Recall F-Measure Compared with DECOR approach [Moha et al.] T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y 63% 51% DECOR TACO OVERALL F-MEASURE OVERALL F-MEASURE
  • 16. TACO - Textual Analysis for Code Smell Detection Apache Cassandra Apache Xerces Eclipse Core Precision Recall F-Measure Compared with DECOR approach [Moha et al.] TACO is highly complementary with respect to DECOR on 2 systems analyzed T H E C A S E O F L O N G M E T H O D D E T E C T I O N - C A S E S T U D Y 63% 51% DECOR TACO OVERALL F-MEASURE OVERALL F-MEASURE
  • 17. A P R AT I C A L E X A M P L E TACO - Textual Analysis for Code Smell Detection Method: findTypesAndPackages() Goal: Discover the classes and the packages of a given project Class: CompletionEngine - Eclipse Core
  • 18. TACO - Textual Analysis for Code Smell Detection Method: findTypesAndPackages() Goal: Discover the classes and the packages of a given project This method has 65 lines of code Class: CompletionEngine - Eclipse Core A P R AT I C A L E X A M P L E
  • 19. TACO - Textual Analysis for Code Smell Detection Method: findTypesAndPackages() Goal: Discover the classes and the packages of a given project This method has 65 lines of code A S TAT I C A P P R O A C H C A N N O T D E T E C T A L O N G M E T H O D Class: CompletionEngine - Eclipse Core A P R AT I C A L E X A M P L E
  • 20. TACO - Textual Analysis for Code Smell Detection Class: CompletionEngine - Eclipse Core Method: findTypesAndPackages() Goal: Discover the classes and the packages of a given project This method has 65 lines of code A S TAT I C A P P R O A C H C A N N O T D E T E C T A L O N G M E T H O D But the method manages more than one responsibility I T A C T U A L LY I S A L O N G M E T H O D ! A P R AT I C A L E X A M P L E
  • 21. I S I T P O S S I B L E T O D E T E C T S M E L L S U S I N G C O N C E P T U A L I N F O R M AT I O N !The Third Dimension YES, IT IS
  • 22. S U M M A R I Z I N G TACO - Textual Analysis for Code Smell Detection Textual Analysis is useful for smell detection
  • 23. Textual Analysis is useful for smell detection Is TACO suitable for detectingother smells? TACO - Textual Analysis for Code Smell Detection What about a hybrid technique for detecting smells? C O M I N G S O O N …
  • 24. Textual Analysis for Code Smell Detection FA B I O PA L O M B A , U N I V E R S I T Y O F S A L E R N O D I B T. U N I M O L . I T / F PA L O M B A I C S E 2 0 1 5 S R C M AY 2 2 , 2 0 1 5 F L O R E N C E , I TA LY