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

What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...
Sławomir Zborowski
 
Datathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdfDatathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdf
RenatoCastro753818
 
Datathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdfDatathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdf
RenatoCastro753818
 
Pintrace: Distributed tracing@Pinterest
Pintrace: Distributed tracing@PinterestPintrace: Distributed tracing@Pinterest
Pintrace: Distributed tracing@Pinterest
Suman Karumuri
 
3rd week internship report
3rd week internship report3rd week internship report
3rd week internship report
Yafie Abdillah
 
Resume_Clasification.pptx
Resume_Clasification.pptxResume_Clasification.pptx
Resume_Clasification.pptx
MOINDALVS
 
Code GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limitersCode GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limiters
Marina Kolpakova
 
AWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 PerthAWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 Perth
Amazon Web Services
 
Auckland AWS Seminar Series
Auckland AWS Seminar SeriesAuckland AWS Seminar Series
Auckland AWS Seminar Series
Amazon Web Services
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamHenryk Konsek
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
DISID
 
Testifire_XTR2_Brochure.pdf
Testifire_XTR2_Brochure.pdfTestifire_XTR2_Brochure.pdf
Testifire_XTR2_Brochure.pdf
Hans Bronkhorst
 
IoT Technical Roadmap
IoT Technical RoadmapIoT Technical Roadmap
IoT Technical Roadmap
Reid Lai
 
SEO orientado a Ventas - DSMVALENCIA 2017
SEO orientado a Ventas - DSMVALENCIA 2017SEO orientado a Ventas - DSMVALENCIA 2017
SEO orientado a Ventas - DSMVALENCIA 2017
Luis M Villanueva
 
Tecnologias de la informacion y la comunicación
Tecnologias de la informacion y la comunicaciónTecnologias de la informacion y la comunicación
Tecnologias de la informacion y la comunicaciónYalil Ramos
 
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
Diego Molla-Aliod
 
AWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 BrisbaneAWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 Brisbane
Amazon Web Services
 
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
Lisa Purvin Oliner
 

Similar to Textual Analysis for Code Smell Detection (20)

What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...
 
Datathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdfDatathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdf
 
Datathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdfDatathon_Entel_2022_Insight_ML.pdf
Datathon_Entel_2022_Insight_ML.pdf
 
Pintrace: Distributed tracing@Pinterest
Pintrace: Distributed tracing@PinterestPintrace: Distributed tracing@Pinterest
Pintrace: Distributed tracing@Pinterest
 
3rd week internship report
3rd week internship report3rd week internship report
3rd week internship report
 
Resume_Clasification.pptx
Resume_Clasification.pptxResume_Clasification.pptx
Resume_Clasification.pptx
 
Code GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limitersCode GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limiters
 
AWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 PerthAWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 Perth
 
Auckland AWS Seminar Series
Auckland AWS Seminar SeriesAuckland AWS Seminar Series
Auckland AWS Seminar Series
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax Exam
 
FSLSO QTR
FSLSO QTRFSLSO QTR
FSLSO QTR
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
Testifire_XTR2_Brochure.pdf
Testifire_XTR2_Brochure.pdfTestifire_XTR2_Brochure.pdf
Testifire_XTR2_Brochure.pdf
 
IoT Technical Roadmap
IoT Technical RoadmapIoT Technical Roadmap
IoT Technical Roadmap
 
SEO orientado a Ventas - DSMVALENCIA 2017
SEO orientado a Ventas - DSMVALENCIA 2017SEO orientado a Ventas - DSMVALENCIA 2017
SEO orientado a Ventas - DSMVALENCIA 2017
 
Tecnologias de la informacion y la comunicación
Tecnologias de la informacion y la comunicaciónTecnologias de la informacion y la comunicación
Tecnologias de la informacion y la comunicación
 
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
Extractive Evidence Based Medicine Summarisation Based on Sentence-Specific S...
 
Tic liz
Tic lizTic liz
Tic liz
 
AWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 BrisbaneAWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 Brisbane
 
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
Presentation Dividers and Article Outlines from AERA Standards for Reporting ...
 

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
 
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
Fabio Palomba
 
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Fabio Palomba
 
A Textual-based Technique for Smell Detection
A Textual-based Technique for Smell DetectionA Textual-based Technique for Smell Detection
A Textual-based Technique for Smell Detection
Fabio Palomba
 
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
Fabio Palomba
 
Extract Package Refactoring in ARIES
Extract Package Refactoring in ARIESExtract Package Refactoring in ARIES
Extract Package Refactoring in ARIES
Fabio Palomba
 
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
Fabio Palomba
 
PhD Symposium 2014
PhD Symposium 2014PhD Symposium 2014
PhD Symposium 2014
Fabio 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 Refactoring
Fabio Palomba
 
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code SmellsDo They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Fabio Palomba
 
People management
People managementPeople management
People management
Fabio 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 activities
Fabio Palomba
 
Detecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History InformationDetecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History Information
Fabio 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 X
Fabio 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 Refactoring
Fabio Palomba
 

More from Fabio Palomba (15)

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?
 
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
 
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
 
A Textual-based Technique for Smell Detection
A Textual-based Technique for Smell DetectionA Textual-based Technique for Smell Detection
A Textual-based Technique for Smell Detection
 
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
 
Extract Package Refactoring in ARIES
Extract Package Refactoring in ARIESExtract Package Refactoring in ARIES
Extract Package Refactoring in ARIES
 
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
 
PhD Symposium 2014
PhD Symposium 2014PhD Symposium 2014
PhD Symposium 2014
 
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
 
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code SmellsDo They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells
 
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
 
Detecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History InformationDetecting Bad Smells in Source Code using Change History Information
Detecting Bad Smells in Source Code using Change History Information
 
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

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 

Recently uploaded (20)

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 

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