Mining the Relationship between
Anti-patterns
Dependencies and FaultProneness
Fehmi Jaafar,

Yann-Gaël Guéhéneuc,

Sylvie ...
Anti-patterns describe poor solutions to
design and implementation problems…

…they are not technically incorrect and don'...
Examples of Anti-patterns
Blob

Large controller class, low cohesion,
associated with simple, data-object
classes…

Spaghe...
Motivation
Many studies have investigated the
impact of anti-patterns on
•Maintenance [Yamashita, 2013]
•Fault-proneness [...
Motivation
Yet, classes sharing static
relationships with anti-patterns
have been mostly ignored…

We conjecture that, sta...
Approach
source code
repository

Antipatterns
detection
DECOR

Bugzilla

Relationships
retrieval
Macocha

Analyses

6

Bug...
Data Collection
Subject systems

# Classes

3,325

1,615

1,191

# Snapshots

4,480

2,010

159,196

Anti-patterns detecte...
Co-change and Static relationships
with Antipatterns
Anti-patterns

Systems

# of CC

# of S.R

13

152

20

201

18

Anti...
Research Questions

9
Analysis Methods

HRQ: The proportions of faults carried by classes
having static (resp. Co-change) relationships with
10
...
RQ1: Are classes that have static
relationships with anti-patterns
more fault-prone than other
classes?
Faults No-Faults

...
RQ2: Are classes that co-change
with anti-patterns more fault-prone
than other classes?
Faults

No-Faults

Odd Ratios

Tot...
Some Observations
 We found no class having a static dependency (i.e. use, association,
aggregation, and composition rela...
14
Upcoming SlideShare
Loading in …5
×

Wcre13c.pdf

268
-1

Published on

Anti-patterns, dependencies, faults, propagation

Published in: Technology, Health & Medicine
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
268
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wcre13c.pdf

  1. 1. Mining the Relationship between Anti-patterns Dependencies and FaultProneness Fehmi Jaafar, Yann-Gaël Guéhéneuc, Sylvie Hamel Foutse Khomh
  2. 2. Anti-patterns describe poor solutions to design and implementation problems… …they are not technically incorrect and don't currently prevent the program from functioning. Instead, they indicate weaknesses in design that may be slowing down development or increasing the risk of bugs or failures in the future. 2
  3. 3. Examples of Anti-patterns Blob Large controller class, low cohesion, associated with simple, data-object classes… Spaghetti Code Process oriented methods, object methods with no parameters, class or global variables utilization, flow of execution dictated by object implementation, not by the clients of the objects. 3
  4. 4. Motivation Many studies have investigated the impact of anti-patterns on •Maintenance [Yamashita, 2013] •Fault-proneness [Khomh, 2012] •Change-proneness [Romano, 2012] ----- 4
  5. 5. Motivation Yet, classes sharing static relationships with anti-patterns have been mostly ignored… We conjecture that, static and co-change relationships with anti-patterns can impact the fault-proneness of classes without anti-patterns. 5
  6. 6. Approach source code repository Antipatterns detection DECOR Bugzilla Relationships retrieval Macocha Analyses 6 Bug information Ibdoos
  7. 7. Data Collection Subject systems # Classes 3,325 1,615 1,191 # Snapshots 4,480 2,010 159,196 Anti-patterns detected with DECOR… • MessageChain • Antisingleton • RefusedParameterBequest • Blob • SpaghettiCode • ClassDataShouldBePrivate (CDSBP) • SpeculativeGenerality • ComplexClass • SwissArmyKnife • LazyClass • LongParameterList • LongMethod 7
  8. 8. Co-change and Static relationships with Antipatterns Anti-patterns Systems # of CC # of S.R 13 152 20 201 18 Anti-patterns Systems # of CC # of S.R 183 304 47 326 36 164 6 183 93 25 93 167 0 0 0 82 0 0 113 0 0 192 13 128 0 146 4 139 0 96 8 201 42 282 20 69 51 314 9 142 0 266 18 108 12 LongParameterList 16 2 LongMethod 188 0 ComplexClass 196 4 CDSBP 8 24 Blob 244 51 Anti singleton 48 344 0 276 0 309 MessageChains RefusedParentBequest Spaghetti Code SpeculativeGenerality SwissArmyKnife
  9. 9. Research Questions 9
  10. 10. Analysis Methods HRQ: The proportions of faults carried by classes having static (resp. Co-change) relationships with 10 anti-patterns and other classes are the same.
  11. 11. RQ1: Are classes that have static relationships with anti-patterns more fault-prone than other classes? Faults No-Faults Odd Ratios Total of classes related to AP 1939 1350 2.22 Classes with S.R with AP and that are not AP. 945 778 1.88 Total of other classes 1117 1725 1 Classes with S.R with AP 1062 1003 Classes with S.R with AP and that are not AP 402 600 Other classes 681 579 Classes with S.R with AP 432 226 Classes with S.R with AP and that are not AP. 281 103 Other classes 310 647 Classes with S.R with AP 445 121 Classes with S.R with AP and that are not AP. 262 75 Other classes 126 499 P-value = 2.2 e-16
  12. 12. RQ2: Are classes that co-change with anti-patterns more fault-prone than other classes? Faults No-Faults Odd Ratios Total of classes co-changing with AP 346 149 2.5 Classes co-changing with AP and that are not AP 173 81 2.3 Total of other classes 2710 2926 1 Classes co-changing with AP 241 102 Classes co-changing with AP and that are not AP 120 59 Other classes 1502 1480 Classes co-changing with AP 68 26 Classes co-changing with AP and that are not AP 33 10 Other classes 674 847 Classes co-changing with AP Classes co-changing with AP and that are not AP Other classes P-value = 2.2 e-16 37 21 20 12 534 599
  13. 13. Some Observations  We found no class having a static dependency (i.e. use, association, aggregation, and composition relationships) or that co-changed with a SpaghettiCode.  We found that classes having static relationships with Blob, ComplexClass, and SwissArmyKnife are significantly more fault prone than other classes with similar complexity, change history, and code size.  Many anti-patterns’ relationships were with classes playing roles in design patterns. Classes that are co-changing with anti-patterns classes are significantly more fault prone than other classes with similar complexity, change history, and code size. 13
  14. 14. 14
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×