SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
House of Cards:
Code Smells in Open-source C# Repositories
Tushar Sharma, Marios Fragkoulis, and Diomidis Spinellis
Funded	by	SENECA	project	under	
Marie-Skłodowska Curie	Actions
Code Smells
…certain structures in the code
that suggest (sometimes they
scream for) the possibility of
refactoring.
- Kent Beck
<!>
http://www.tusharma.in/smells/
A Taxonomy of Software Smells
Identified gap
• Existing mining studies on smells lack
• scale (Number of subject systems analyzed), and
• breadth (Number of smells detected)
• Solely performed on Java subject systems
Overview of the study
Research
questions
1988 open-source
repositories
Designite
<!>
19 Design smells
11 Implementation
smells
Results
Detected design smells
Abstraction smells:
• Duplicate Abstraction
• Imperative Abstraction
• Multifaceted Abstraction
• Unnecessary Abstraction
• Unutilized Abstraction
Encapsulation smells:
• Deficient Encapsulation
• Unexploited Encapsulation
Modularization smells:
• Broken Modularization
• Cyclically-dependent
Modularization
• Hub-like Modularization
• Insufficient Modularization
Hierarchy smells:
• Broken Hierarchy
• Cyclic Hierarchy
• Deep Hierarchy
• Missing Hierarchy
• Multipath Hierarchy
• Rebellious Hierarchy
• Unfactored Hierarchy
• Wide Hierarchy
Detected implementation smells
• Complex Conditional
• Complex Method
• Duplicate Code
• Empty Catch Block
• Long Identifier
• Long Method
• Long Parameter List
• Long Statement
• Magic Number
• Missing Default
• Virtual Method Call from Constructor
Mining GitHub C# repositories
Repositories 1,988
Number	of	types 436,832
Number	of	methods 2,265,971
Lines	of	Code	(C#) 49,303,314
Median	LOC 4,391
RQ1. Frequency of smells
RQ1. What is the distribution of design and
implementation smells in C# code?
Unutilized	Abstraction 90,786
Duplicate	Abstraction 73,992
Unnecessary	Abstraction 44,583
Imperative	Abstraction 11,790
Multifaceted	Abstraction 1,236
Deficient	Encapsulation 30,214
Unexploited	Encapsulation 6,964
Cyclically-dependent	
Modularization
52,436
Insufficient	
Modularization
26,429
Broken	Modularization 15,624
Hub-like	Modularization 676
Unfactored Hierarchy 20,962
Broken	Hierarchy 20,332
Rebellious	Hierarchy 11,794
Cyclic	Hierarchy 4,342
Wide	Hierarchy 3,140
Missing	Hierarchy 2,598
Multipath	Hierarchy 1,454
Deep	Hierarchy 179
RQ1. What is the distribution of design and
implementation smells in C# code?
Unutilized	Abstraction 90,786
Duplicate	Abstraction 73,992
Unnecessary	Abstraction 44,583
Imperative	Abstraction 11,790
Multifaceted	Abstraction 1,236
Deficient	Encapsulation 30,214
Unexploited	Encapsulation 6,964
Cyclically-dependent	
Modularization
52,436
Insufficient	
Modularization
26,429
Broken	Modularization 15,624
Hub-like	Modularization 676
Unfactored Hierarchy 20,962
Broken	Hierarchy 20,332
Rebellious	Hierarchy 11,794
Cyclic	Hierarchy 4,342
Wide	Hierarchy 3,140
Missing	Hierarchy 2,598
Multipath	Hierarchy 1,454
Deep	Hierarchy 179
RQ1. What is the distribution of design and
implementation smells in C# code?
Magic	Number 2,993,353
Long	Statement 462,491
Complex	Method 95,244
Long	Parameter	List 79,899
Missing	Default 23,497
Complex	Conditional 21,643
Duplicate	Code 17,921
Long	Method 17,521
Empty	Catch	Block 14,560
Long	Identifier 7,741
Virtual	Method	Call	from	
Constructor
4,545
RQ1. What is the distribution of design and
implementation smells in C# code?
Magic	Number 2,993,353
Long	Statement 462,491
Complex	Method 95,244
Long	Parameter	List 79,899
Missing	Default 23,497
Complex	Conditional 21,643
Duplicate	Code 17,921
Long	Method 17,521
Empty	Catch	Block 14,560
Long	Identifier 7,741
Virtual	Method	Call	from	
Constructor
4,545
On	average,	
one	magic	
number	smell	
per	16	lines	of	
code!!
RQ2. Inter-category co-occurrence
RQ2. What is the relationship between the
occurrence of design smells and implementation
smells?
0 5 10 15 20
0
2
4
6
8
10
12
Design Smells
ImplementationSmells
1
8
15
22
30
37
44
51
58
65
72
79
86
94
101
108
115
Counts
Co-occurrence between smell instances
⍴ = 0.78 (p-value < 2.2e-16)
Co-occurrence between smell types
⍴ = 0.80 (p-value < 2.2e-16)
The	results	emphasize	the	need	to	pay	
attention	to	smells	at	all	granularities.0 50 100 150 200 250 300
02004006008001000
Design Smells
Implementationsmells
RQ3. Intra-category co-occurrence
RQ3. Is the principle of coexistence applicable to
smells in C# projects?
𝐶 𝑠1, 𝑠2 =	
𝑛1	 ∗ 𝑛2
𝑁
RQ4. Smell density and project size
RQ4. Does smell density depend on the size of the
C# repository?
0 50000 100000 150000 200000
020406080100
LOC
DesignSmellsDensity
0 50000 100000 150000 200000
0100200300400500
LOC
ImplementationSmellsDensity
⍴ = -0.25 (p-value < 2.2e-16) ⍴ = 0.27 (p-value < 2.2e-16)
Each C# class that you work with, on average, has approximately
• 2 design smells (113*14.7/1000 = 1.67) and
• 6 implementation smells (113*55.8/1000 = 6.2)
House of Cards: Code Smells in Open-source C# Repositories

Más contenido relacionado

Similar a House of Cards: Code Smells in Open-source C# Repositories

Growing Software and Growing Ourselves
Growing Software and Growing OurselvesGrowing Software and Growing Ourselves
Growing Software and Growing OurselvesDaniel Parkin
 
Code smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software OdorsCode smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software OdorsClint Edmonson
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"GlobalLogic Ukraine
 
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010Atlassian
 
Designite – Software Design Quality Assessment Tool
Designite – Software Design Quality Assessment ToolDesignite – Software Design Quality Assessment Tool
Designite – Software Design Quality Assessment ToolTushar Sharma
 
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0Marcel Bruch
 
Mock-interview-ppt (A)- Copy.pptx
Mock-interview-ppt (A)- Copy.pptxMock-interview-ppt (A)- Copy.pptx
Mock-interview-ppt (A)- Copy.pptxLaxmiKabadi
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternTalentica Software
 

Similar a House of Cards: Code Smells in Open-source C# Repositories (10)

Growing Software and Growing Ourselves
Growing Software and Growing OurselvesGrowing Software and Growing Ourselves
Growing Software and Growing Ourselves
 
Code smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software OdorsCode smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software Odors
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Tech talks#6: Code Refactoring
Tech talks#6: Code RefactoringTech talks#6: Code Refactoring
Tech talks#6: Code Refactoring
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
 
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
 
Designite – Software Design Quality Assessment Tool
Designite – Software Design Quality Assessment ToolDesignite – Software Design Quality Assessment Tool
Designite – Software Design Quality Assessment Tool
 
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0
JUG Münster 2014 - Code Recommenders & Codetrails - Wissenstransfer 2.0
 
Mock-interview-ppt (A)- Copy.pptx
Mock-interview-ppt (A)- Copy.pptxMock-interview-ppt (A)- Copy.pptx
Mock-interview-ppt (A)- Copy.pptx
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
 

Más de Tushar Sharma

The tail of two source-code analysis tools - Learning and experiences
The tail of two source-code analysis tools - Learning and experiencesThe tail of two source-code analysis tools - Learning and experiences
The tail of two source-code analysis tools - Learning and experiencesTushar Sharma
 
Designite: A Customizable Tool for Smell Mining in C# Repositories
Designite: A Customizable Tool for Smell Mining in C# RepositoriesDesignite: A Customizable Tool for Smell Mining in C# Repositories
Designite: A Customizable Tool for Smell Mining in C# RepositoriesTushar Sharma
 
Writing Maintainable Code
Writing Maintainable Code Writing Maintainable Code
Writing Maintainable Code Tushar Sharma
 
FOSDEM - Does your configuration code smell?
FOSDEM - Does your configuration code smell?FOSDEM - Does your configuration code smell?
FOSDEM - Does your configuration code smell?Tushar Sharma
 
Achieving Design Agility by Refactoring Design Smells
Achieving Design Agility by Refactoring Design SmellsAchieving Design Agility by Refactoring Design Smells
Achieving Design Agility by Refactoring Design SmellsTushar Sharma
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?Tushar Sharma
 
Does Your Configuration Code Smell?
Does Your Configuration Code Smell?Does Your Configuration Code Smell?
Does Your Configuration Code Smell?Tushar Sharma
 
Technical debt - The elephant in the room
Technical debt - The elephant in the roomTechnical debt - The elephant in the room
Technical debt - The elephant in the roomTushar Sharma
 
Understanding software metrics
Understanding software metricsUnderstanding software metrics
Understanding software metricsTushar Sharma
 
Pragmatic Technical Debt Management
Pragmatic Technical Debt ManagementPragmatic Technical Debt Management
Pragmatic Technical Debt ManagementTushar Sharma
 
Infographic - Pragmatic Technical Debt Management
Infographic - Pragmatic Technical Debt ManagementInfographic - Pragmatic Technical Debt Management
Infographic - Pragmatic Technical Debt ManagementTushar Sharma
 
Applying Design Principles in Practice
Applying Design Principles in PracticeApplying Design Principles in Practice
Applying Design Principles in PracticeTushar Sharma
 
Why care about technical debt?
Why care about technical debt?Why care about technical debt?
Why care about technical debt?Tushar Sharma
 
Does your design smell?
Does your design smell?Does your design smell?
Does your design smell?Tushar Sharma
 
A Checklist for Design Reviews
A Checklist for Design ReviewsA Checklist for Design Reviews
A Checklist for Design ReviewsTushar Sharma
 
Tools for refactoring
Tools for refactoringTools for refactoring
Tools for refactoringTushar Sharma
 
Towards a Principle-based Classification of Structural Design Smells
Towards a Principle-based Classification of Structural Design SmellsTowards a Principle-based Classification of Structural Design Smells
Towards a Principle-based Classification of Structural Design SmellsTushar Sharma
 
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and EncapsulationPHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and EncapsulationTushar Sharma
 
Refactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 TutorialRefactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 TutorialTushar Sharma
 
Refactoring for Software Design Smells: Managing Technical Debt
Refactoring for Software Design Smells: Managing Technical DebtRefactoring for Software Design Smells: Managing Technical Debt
Refactoring for Software Design Smells: Managing Technical DebtTushar Sharma
 

Más de Tushar Sharma (20)

The tail of two source-code analysis tools - Learning and experiences
The tail of two source-code analysis tools - Learning and experiencesThe tail of two source-code analysis tools - Learning and experiences
The tail of two source-code analysis tools - Learning and experiences
 
Designite: A Customizable Tool for Smell Mining in C# Repositories
Designite: A Customizable Tool for Smell Mining in C# RepositoriesDesignite: A Customizable Tool for Smell Mining in C# Repositories
Designite: A Customizable Tool for Smell Mining in C# Repositories
 
Writing Maintainable Code
Writing Maintainable Code Writing Maintainable Code
Writing Maintainable Code
 
FOSDEM - Does your configuration code smell?
FOSDEM - Does your configuration code smell?FOSDEM - Does your configuration code smell?
FOSDEM - Does your configuration code smell?
 
Achieving Design Agility by Refactoring Design Smells
Achieving Design Agility by Refactoring Design SmellsAchieving Design Agility by Refactoring Design Smells
Achieving Design Agility by Refactoring Design Smells
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
Does Your Configuration Code Smell?
Does Your Configuration Code Smell?Does Your Configuration Code Smell?
Does Your Configuration Code Smell?
 
Technical debt - The elephant in the room
Technical debt - The elephant in the roomTechnical debt - The elephant in the room
Technical debt - The elephant in the room
 
Understanding software metrics
Understanding software metricsUnderstanding software metrics
Understanding software metrics
 
Pragmatic Technical Debt Management
Pragmatic Technical Debt ManagementPragmatic Technical Debt Management
Pragmatic Technical Debt Management
 
Infographic - Pragmatic Technical Debt Management
Infographic - Pragmatic Technical Debt ManagementInfographic - Pragmatic Technical Debt Management
Infographic - Pragmatic Technical Debt Management
 
Applying Design Principles in Practice
Applying Design Principles in PracticeApplying Design Principles in Practice
Applying Design Principles in Practice
 
Why care about technical debt?
Why care about technical debt?Why care about technical debt?
Why care about technical debt?
 
Does your design smell?
Does your design smell?Does your design smell?
Does your design smell?
 
A Checklist for Design Reviews
A Checklist for Design ReviewsA Checklist for Design Reviews
A Checklist for Design Reviews
 
Tools for refactoring
Tools for refactoringTools for refactoring
Tools for refactoring
 
Towards a Principle-based Classification of Structural Design Smells
Towards a Principle-based Classification of Structural Design SmellsTowards a Principle-based Classification of Structural Design Smells
Towards a Principle-based Classification of Structural Design Smells
 
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and EncapsulationPHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
 
Refactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 TutorialRefactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 Tutorial
 
Refactoring for Software Design Smells: Managing Technical Debt
Refactoring for Software Design Smells: Managing Technical DebtRefactoring for Software Design Smells: Managing Technical Debt
Refactoring for Software Design Smells: Managing Technical Debt
 

Último

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Último (20)

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

House of Cards: Code Smells in Open-source C# Repositories

  • 1. House of Cards: Code Smells in Open-source C# Repositories Tushar Sharma, Marios Fragkoulis, and Diomidis Spinellis Funded by SENECA project under Marie-Skłodowska Curie Actions
  • 2.
  • 3. Code Smells …certain structures in the code that suggest (sometimes they scream for) the possibility of refactoring. - Kent Beck <!>
  • 5. Identified gap • Existing mining studies on smells lack • scale (Number of subject systems analyzed), and • breadth (Number of smells detected) • Solely performed on Java subject systems
  • 6. Overview of the study Research questions 1988 open-source repositories Designite <!> 19 Design smells 11 Implementation smells Results
  • 7. Detected design smells Abstraction smells: • Duplicate Abstraction • Imperative Abstraction • Multifaceted Abstraction • Unnecessary Abstraction • Unutilized Abstraction Encapsulation smells: • Deficient Encapsulation • Unexploited Encapsulation Modularization smells: • Broken Modularization • Cyclically-dependent Modularization • Hub-like Modularization • Insufficient Modularization Hierarchy smells: • Broken Hierarchy • Cyclic Hierarchy • Deep Hierarchy • Missing Hierarchy • Multipath Hierarchy • Rebellious Hierarchy • Unfactored Hierarchy • Wide Hierarchy
  • 8. Detected implementation smells • Complex Conditional • Complex Method • Duplicate Code • Empty Catch Block • Long Identifier • Long Method • Long Parameter List • Long Statement • Magic Number • Missing Default • Virtual Method Call from Constructor
  • 9. Mining GitHub C# repositories Repositories 1,988 Number of types 436,832 Number of methods 2,265,971 Lines of Code (C#) 49,303,314 Median LOC 4,391
  • 11. RQ1. What is the distribution of design and implementation smells in C# code? Unutilized Abstraction 90,786 Duplicate Abstraction 73,992 Unnecessary Abstraction 44,583 Imperative Abstraction 11,790 Multifaceted Abstraction 1,236 Deficient Encapsulation 30,214 Unexploited Encapsulation 6,964 Cyclically-dependent Modularization 52,436 Insufficient Modularization 26,429 Broken Modularization 15,624 Hub-like Modularization 676 Unfactored Hierarchy 20,962 Broken Hierarchy 20,332 Rebellious Hierarchy 11,794 Cyclic Hierarchy 4,342 Wide Hierarchy 3,140 Missing Hierarchy 2,598 Multipath Hierarchy 1,454 Deep Hierarchy 179
  • 12. RQ1. What is the distribution of design and implementation smells in C# code? Unutilized Abstraction 90,786 Duplicate Abstraction 73,992 Unnecessary Abstraction 44,583 Imperative Abstraction 11,790 Multifaceted Abstraction 1,236 Deficient Encapsulation 30,214 Unexploited Encapsulation 6,964 Cyclically-dependent Modularization 52,436 Insufficient Modularization 26,429 Broken Modularization 15,624 Hub-like Modularization 676 Unfactored Hierarchy 20,962 Broken Hierarchy 20,332 Rebellious Hierarchy 11,794 Cyclic Hierarchy 4,342 Wide Hierarchy 3,140 Missing Hierarchy 2,598 Multipath Hierarchy 1,454 Deep Hierarchy 179
  • 13. RQ1. What is the distribution of design and implementation smells in C# code? Magic Number 2,993,353 Long Statement 462,491 Complex Method 95,244 Long Parameter List 79,899 Missing Default 23,497 Complex Conditional 21,643 Duplicate Code 17,921 Long Method 17,521 Empty Catch Block 14,560 Long Identifier 7,741 Virtual Method Call from Constructor 4,545
  • 14. RQ1. What is the distribution of design and implementation smells in C# code? Magic Number 2,993,353 Long Statement 462,491 Complex Method 95,244 Long Parameter List 79,899 Missing Default 23,497 Complex Conditional 21,643 Duplicate Code 17,921 Long Method 17,521 Empty Catch Block 14,560 Long Identifier 7,741 Virtual Method Call from Constructor 4,545 On average, one magic number smell per 16 lines of code!!
  • 16. RQ2. What is the relationship between the occurrence of design smells and implementation smells? 0 5 10 15 20 0 2 4 6 8 10 12 Design Smells ImplementationSmells 1 8 15 22 30 37 44 51 58 65 72 79 86 94 101 108 115 Counts Co-occurrence between smell instances ⍴ = 0.78 (p-value < 2.2e-16) Co-occurrence between smell types ⍴ = 0.80 (p-value < 2.2e-16) The results emphasize the need to pay attention to smells at all granularities.0 50 100 150 200 250 300 02004006008001000 Design Smells Implementationsmells
  • 18. RQ3. Is the principle of coexistence applicable to smells in C# projects? 𝐶 𝑠1, 𝑠2 = 𝑛1 ∗ 𝑛2 𝑁
  • 19. RQ4. Smell density and project size
  • 20. RQ4. Does smell density depend on the size of the C# repository? 0 50000 100000 150000 200000 020406080100 LOC DesignSmellsDensity 0 50000 100000 150000 200000 0100200300400500 LOC ImplementationSmellsDensity ⍴ = -0.25 (p-value < 2.2e-16) ⍴ = 0.27 (p-value < 2.2e-16)
  • 21. Each C# class that you work with, on average, has approximately • 2 design smells (113*14.7/1000 = 1.67) and • 6 implementation smells (113*55.8/1000 = 6.2)