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
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!!
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)