Analyzing Code Evolution
to Uncover Relations
between Bad Smells
Angela Lozano, Kim Mens, Jawira Portugal
@ang_loza #SANER15
PPAP 2015
More info:
alozano@soft.vub.ac.be
Agenda
• Bad smells
• Inter-smell relations
• Experiment
• Results
• Conclusions
Bad smells
Bad smells
• Bad smell?: indicator that points to parts of the code
that may need to be refactored
• Bad smells analyzed:
• Feature Envy (FE)
• Long Method (LM)
• Type Checking (TC)
• God Class (GC)
Inter-smell relations
Why are relations between
smells interesting?
• Easier to detect
• More complex to eliminate
• May indicate “high-level” smells
Inter-smell relations
[Pietrzak & Walter, XP 06]
Plain support a —> b
a = Data Class
b = Feature Envy
Mutual support a <—> b ?
Rejection a -/-> b
a = Lazy Class
b = Large Class
Common refactoring !a —> !b ∨ !a —> b
a = Feature Envy
b = Lazy Class
Inclusion a ==> b
a = Parallel inheritance
b = Shotgun surgery
+Aggregate, +Transitive
Experiment
Data collectedri
ri+1
Log4j 1.2.1 -1.2.17 16 releases
Apr 04 - Feb 13
106 months
JMol 1.0 - 11.0 34 releases
May 01 - Mar 07
70 months
JFreeChart 0.5.6 - 1.0.14 45 releases
Dec 00- Nov 11
131 months
rN
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
• disappear(BS): number of SCEs (Classes or
Methods) where the bad smell was present in the
previous analyzed version of the source code but is
no longer present in the currently analyzed version
• co-disappear(BS1, BS2): number of SCEs
(Classes or Methods) where both both bad smells BS1
and BS2 disappeared from the analyzed entity with
respect to the previous analyzed version of the source
code
1) Indirect Metrics: Using on these basic metrics we
derive additional metrics:
exist overlap(BS1, BS2) =
co exist(BS1, BS2)
exist(BS1)
disappear overlap(BS1, BS2) =
co disappear(BS1, BS2)
disappear(BS1)
Note that these metrics are not symmetric e.g., exist-
III. RESULTS
Figure 1 shows the amount of bad sme
trough all versions analyzed. The most commo
all case studies were long method (LM) and
The least frequent bad smell is type checking
Fig. 1: Cumulative number of bad smells foun
Table I shows that the number of instances
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
• disappear(BS): number of SCEs (Classes or
Methods) where the bad smell was present in the
previous analyzed version of the source code but is
no longer present in the currently analyzed version
• co-disappear(BS1, BS2): number of SCEs
(Classes or Methods) where both both bad smells BS1
and BS2 disappeared from the analyzed entity with
respect to the previous analyzed version of the source
code
1) Indirect Metrics: Using on these basic metrics we
derive additional metrics:
exist overlap(BS1, BS2) =
co exist(BS1, BS2)
exist(BS1)
disappear overlap(BS1, BS2) =
co disappear(BS1, BS2)
disappear(BS1)
Note that these metrics are not symmetric e.g., exist-
III. RESULTS
Figure 1 shows the amount of bad sme
trough all versions analyzed. The most commo
all case studies were long method (LM) and
The least frequent bad smell is type checking
Fig. 1: Cumulative number of bad smells foun
Table I shows that the number of instances
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Data collected
ri
ri+1
LM FE TC GC
package1 Class1 method1() X
package1 Class1 method2(int) X
XX
X
package1 Class1 method3(float,int) X X
package1 Class1 method4(String) X X
package2 Class2 method5() X
package2 Class3 method6(Object) X X
LM FE TC GC
package1 Class1 method1()
package1 Class1 method2(int) X
XXpackage1 Class4 method3(float,int) X
package1 Class4 method4(String) X
package2 Class2 method5() X
package2 Class3 method6(Object)
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
• disappear(BS): number of SCEs (Classes or
Methods) where the bad smell was present in the
previous analyzed version of the source code but is
no longer present in the currently analyzed version
• co-disappear(BS1, BS2): number of SCEs
(Classes or Methods) where both both bad smells BS1
and BS2 disappeared from the analyzed entity with
respect to the previous analyzed version of the source
code
1) Indirect Metrics: Using on these basic metrics we
derive additional metrics:
exist overlap(BS1, BS2) =
co exist(BS1, BS2)
exist(BS1)
disappear overlap(BS1, BS2) =
co disappear(BS1, BS2)
disappear(BS1)
Note that these metrics are not symmetric e.g., exist-
III. RESULTS
Figure 1 shows the amount of bad sme
trough all versions analyzed. The most commo
all case studies were long method (LM) and
The least frequent bad smell is type checking
Fig. 1: Cumulative number of bad smells foun
Table I shows that the number of instances
dissapear-overlap
(LM,FE) = 1/1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
!
(FE,LM) = 1/1
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
GC —> LM
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
co-exist
(TC,GC) = 1
(LM,GC) = 1
(FE,GC) = 1
(LM,FE) = 1
(TC,LM) = 0
(TC,FE) = 0
TC -/-> LM
TC -/-> FE
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
dissapear-overlap
(LM,FE) = 1/1
!
(FE,LM) = 1/1
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
GC ==> FE
GC ==> TC
LM ==> FE
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Detecting inter-smell relations
exist
(LM) = 3
(FE) = 2
(TC) = 1
(GC) = 1
dissapear
(LM) = 1
(FE) = 1
(GC) = 1
co-dissapear
(LM,FE) = 1
exist
(LM) = 3+2=5
(FE) = 2+1=3
(TC) = 1+1=2
(GC) = 1+0=1
exist-overlap
(TC,GC) = 1/2
(LM,GC) = 1/5
(FE,GC) = 1/2
(LM,FE) = 1/1
!
(GC,TC) = 1/1
(GC,LM) = 1/1
(GC,FE) = 1/1
(FE,LM) = 1/3
GC ==> FE
GC ==> TC
LM ==> FE
Results
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? LM
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? LM
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
=>
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
-/->
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? GCTABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
FE ??? GCTABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
—>
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
GC ??? LM
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
GC ??? LM
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
<—>
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
GC ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
is study ignores the analysis of bad smells that cannot
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
methods and classes with disjunct sets of methods are
to have methods that are handling more than one data/
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
GC ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
is study ignores the analysis of bad smells that cannot
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
methods and classes with disjunct sets of methods are
to have methods that are handling more than one data/
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
-/->
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
LM ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
is study ignores the analysis of bad smells that cannot
nd by JDeodorant (and their corresponding relations).
s, bad smells for which it could not find an automatic
oring, or whose refactoring does not ’improve’ the source
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
methods and classes with disjunct sets of methods are
to have methods that are handling more than one data/
flow path (GC $ LM).
C. Threats to Validity
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
Plain support a —> b exist-overlap(a, b) >> exist-overlap(b, a)
Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a)
Rejection a -/-> b co-exist(a, b) ≈ 0
Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a)
Inclusion a ==> b exist-overlap(a, b) ≈ 1
Results:
LM ??? TC
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
! LM) or if there is mutual support (GC $ LM). We
ded that the relation between these two bad smells is
l support because there is not enough evidence to con-
a common refactoring (even though some refactorings
ate both of them).
scussion
is study ignores the analysis of bad smells that cannot
nd by JDeodorant (and their corresponding relations).
s, bad smells for which it could not find an automatic
oring, or whose refactoring does not ’improve’ the source
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
that handle multiple abstractions/responsibilities (TC 6!
TC 6! LM, and TC 6! GC). Whenever a met
located in the wrong class it is likely to be dealin
separable data/control flow paths (FE ) LM). Metho
are wrongly located are likely to be a part of a disju
of methods within their class (FE ! GC). Finally, se
methods are likely to belong to classes with disjunct
methods and classes with disjunct sets of methods are
to have methods that are handling more than one data/
flow path (GC $ LM).
C. Threats to Validity
TABLE II: Median of the metrics used to identify relations
Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A)
A = FE, B = LM
Log4J 0.94 0. 15 15 1 0
Jmol 1 0 27 0 0
JFreechart 0.92 0.1 22 0.14 0
A = FE, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = FE, B = GC
Log4J 0.44 0.16 7 0 0
Jmol 0.85 0.27 28 0.17 0
JFreechart 0.76 0.17 16 0 0
A = GC, B = LM
Log4J 0.75 0.34 33 0 0
Jmol 0.83 0.51 82 0.27 0.39
JFreechart 0.75 0.4 73 0 0.06
A = GC, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
A = LM, B = TC
Log4J 0 0 0 0 0
Jmol 0 0 0 0 0
JFreechart 0 0 0 0 0
is difference between exist-overlaps is lower (40%, 30%,
5%) for god classes co-existing with long methods, so it
cult to decide whether god classes support long methods
there is no reason for methods that should be implemente
the template or the strategy pattern to be longer, requir
services of classes other than its own, or be located in
-/->
Conclusions
Conclusions
• If TC then neither LM, FE or GC. If LM, FE or GC then there is not TC.
• GC indicates LM and FE.
• FE only occurs in LM
LM FE TC GC
LM <== <-/- <—>
FE <-/- <—
TC -/->
GC
a —> b Plain support
a <—> b Mutual support
a -/-> b Rejection
!a —> !b Common
refactoringa ==> b Inclusion
FE: Feature Envy
LM: Long Method
TC: Type Checking
GC: God Class
Conventions
Read the table
in this direction
Conclusions
• If TC then neither LM, FE or GC. If LM, FE or GC then there is not TC.
• GC indicates LM and FE.
• FE only occurs in LM
LM FE TC GC
LM <== <-/- <—>
FE <-/- <—
TC -/->
GC
GC
LM
FE
TC
Detection
a —> b Plain support
a <—> b Mutual support
a -/-> b Rejection
!a —> !b Common
refactoringa ==> b Inclusion
FE: Feature Envy
LM: Long Method
TC: Type Checking
GC: God Class
Conventions
Read the table
in this direction
Conclusions
• If TC then neither LM, FE or GC. If LM, FE or GC then there is not TC.
• GC indicates LM and FE.
• FE only occurs in LM
LM FE TC GC
LM <== <-/- <—>
FE <-/- <—
TC -/->
GC
GC
LM
FE
TC
Detection FE
LM
GC
TCRemoval
a —> b Plain support
a <—> b Mutual support
a -/-> b Rejection
!a —> !b Common
refactoringa ==> b Inclusion
FE: Feature Envy
LM: Long Method
TC: Type Checking
GC: God Class
Conventions
Read the table
in this direction

Analyzing Code Evolution to Uncover Relations between Bad Smells

  • 1.
    Analyzing Code Evolution toUncover Relations between Bad Smells Angela Lozano, Kim Mens, Jawira Portugal @ang_loza #SANER15 PPAP 2015 More info: alozano@soft.vub.ac.be
  • 2.
    Agenda • Bad smells •Inter-smell relations • Experiment • Results • Conclusions
  • 3.
  • 4.
    Bad smells • Badsmell?: indicator that points to parts of the code that may need to be refactored • Bad smells analyzed: • Feature Envy (FE) • Long Method (LM) • Type Checking (TC) • God Class (GC)
  • 5.
  • 6.
    Why are relationsbetween smells interesting? • Easier to detect • More complex to eliminate • May indicate “high-level” smells
  • 7.
    Inter-smell relations [Pietrzak &Walter, XP 06] Plain support a —> b a = Data Class b = Feature Envy Mutual support a <—> b ? Rejection a -/-> b a = Lazy Class b = Large Class Common refactoring !a —> !b ∨ !a —> b a = Feature Envy b = Lazy Class Inclusion a ==> b a = Parallel inheritance b = Shotgun surgery +Aggregate, +Transitive
  • 8.
  • 9.
    Data collectedri ri+1 Log4j 1.2.1-1.2.17 16 releases Apr 04 - Feb 13 106 months JMol 1.0 - 11.0 34 releases May 01 - Mar 07 70 months JFreeChart 0.5.6 - 1.0.14 45 releases Dec 00- Nov 11 131 months rN
  • 10.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X
  • 11.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1
  • 12.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 13.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 14.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 15.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 16.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 17.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 18.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 19.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 • disappear(BS): number of SCEs (Classes or Methods) where the bad smell was present in the previous analyzed version of the source code but is no longer present in the currently analyzed version • co-disappear(BS1, BS2): number of SCEs (Classes or Methods) where both both bad smells BS1 and BS2 disappeared from the analyzed entity with respect to the previous analyzed version of the source code 1) Indirect Metrics: Using on these basic metrics we derive additional metrics: exist overlap(BS1, BS2) = co exist(BS1, BS2) exist(BS1) disappear overlap(BS1, BS2) = co disappear(BS1, BS2) disappear(BS1) Note that these metrics are not symmetric e.g., exist- III. RESULTS Figure 1 shows the amount of bad sme trough all versions analyzed. The most commo all case studies were long method (LM) and The least frequent bad smell is type checking Fig. 1: Cumulative number of bad smells foun Table I shows that the number of instances exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 20.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 • disappear(BS): number of SCEs (Classes or Methods) where the bad smell was present in the previous analyzed version of the source code but is no longer present in the currently analyzed version • co-disappear(BS1, BS2): number of SCEs (Classes or Methods) where both both bad smells BS1 and BS2 disappeared from the analyzed entity with respect to the previous analyzed version of the source code 1) Indirect Metrics: Using on these basic metrics we derive additional metrics: exist overlap(BS1, BS2) = co exist(BS1, BS2) exist(BS1) disappear overlap(BS1, BS2) = co disappear(BS1, BS2) disappear(BS1) Note that these metrics are not symmetric e.g., exist- III. RESULTS Figure 1 shows the amount of bad sme trough all versions analyzed. The most commo all case studies were long method (LM) and The least frequent bad smell is type checking Fig. 1: Cumulative number of bad smells foun Table I shows that the number of instances exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 21.
    Data collected ri ri+1 LM FETC GC package1 Class1 method1() X package1 Class1 method2(int) X XX X package1 Class1 method3(float,int) X X package1 Class1 method4(String) X X package2 Class2 method5() X package2 Class3 method6(Object) X X LM FE TC GC package1 Class1 method1() package1 Class1 method2(int) X XXpackage1 Class4 method3(float,int) X package1 Class4 method4(String) X package2 Class2 method5() X package2 Class3 method6(Object) exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 • disappear(BS): number of SCEs (Classes or Methods) where the bad smell was present in the previous analyzed version of the source code but is no longer present in the currently analyzed version • co-disappear(BS1, BS2): number of SCEs (Classes or Methods) where both both bad smells BS1 and BS2 disappeared from the analyzed entity with respect to the previous analyzed version of the source code 1) Indirect Metrics: Using on these basic metrics we derive additional metrics: exist overlap(BS1, BS2) = co exist(BS1, BS2) exist(BS1) disappear overlap(BS1, BS2) = co disappear(BS1, BS2) disappear(BS1) Note that these metrics are not symmetric e.g., exist- III. RESULTS Figure 1 shows the amount of bad sme trough all versions analyzed. The most commo all case studies were long method (LM) and The least frequent bad smell is type checking Fig. 1: Cumulative number of bad smells foun Table I shows that the number of instances dissapear-overlap (LM,FE) = 1/1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 ! (FE,LM) = 1/1 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0
  • 22.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1
  • 23.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 GC —> LM
  • 24.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3
  • 25.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 co-exist (TC,GC) = 1 (LM,GC) = 1 (FE,GC) = 1 (LM,FE) = 1 (TC,LM) = 0 (TC,FE) = 0 TC -/-> LM TC -/-> FE
  • 26.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 dissapear-overlap (LM,FE) = 1/1 ! (FE,LM) = 1/1
  • 27.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 GC ==> FE GC ==> TC LM ==> FE
  • 28.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Detecting inter-smell relations exist (LM) = 3 (FE) = 2 (TC) = 1 (GC) = 1 dissapear (LM) = 1 (FE) = 1 (GC) = 1 co-dissapear (LM,FE) = 1 exist (LM) = 3+2=5 (FE) = 2+1=3 (TC) = 1+1=2 (GC) = 1+0=1 exist-overlap (TC,GC) = 1/2 (LM,GC) = 1/5 (FE,GC) = 1/2 (LM,FE) = 1/1 ! (GC,TC) = 1/1 (GC,LM) = 1/1 (GC,FE) = 1/1 (FE,LM) = 1/3 GC ==> FE GC ==> TC LM ==> FE
  • 29.
  • 30.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? LM TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 31.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? LM TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in =>
  • 32.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 33.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in -/->
  • 34.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? GCTABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 35.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: FE ??? GCTABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in —>
  • 36.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: GC ??? LM TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 37.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: GC ??? LM TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in <—>
  • 38.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: GC ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion is study ignores the analysis of bad smells that cannot there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct methods and classes with disjunct sets of methods are to have methods that are handling more than one data/ TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 39.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: GC ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion is study ignores the analysis of bad smells that cannot there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct methods and classes with disjunct sets of methods are to have methods that are handling more than one data/ TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in -/->
  • 40.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: LM ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion is study ignores the analysis of bad smells that cannot nd by JDeodorant (and their corresponding relations). s, bad smells for which it could not find an automatic oring, or whose refactoring does not ’improve’ the source there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct methods and classes with disjunct sets of methods are to have methods that are handling more than one data/ flow path (GC $ LM). C. Threats to Validity TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in
  • 41.
    Plain support a—> b exist-overlap(a, b) >> exist-overlap(b, a) Mutual support a <—> b exist-overlap(a, b) ≈ exist-overlap(b, a) Rejection a -/-> b co-exist(a, b) ≈ 0 Common refactoring !a —> !b disappear-overlap(a, b) >> dissappear-overlap(b, a) Inclusion a ==> b exist-overlap(a, b) ≈ 1 Results: LM ??? TC TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods ! LM) or if there is mutual support (GC $ LM). We ded that the relation between these two bad smells is l support because there is not enough evidence to con- a common refactoring (even though some refactorings ate both of them). scussion is study ignores the analysis of bad smells that cannot nd by JDeodorant (and their corresponding relations). s, bad smells for which it could not find an automatic oring, or whose refactoring does not ’improve’ the source there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in that handle multiple abstractions/responsibilities (TC 6! TC 6! LM, and TC 6! GC). Whenever a met located in the wrong class it is likely to be dealin separable data/control flow paths (FE ) LM). Metho are wrongly located are likely to be a part of a disju of methods within their class (FE ! GC). Finally, se methods are likely to belong to classes with disjunct methods and classes with disjunct sets of methods are to have methods that are handling more than one data/ flow path (GC $ LM). C. Threats to Validity TABLE II: Median of the metrics used to identify relations Bad Smells App exist-overlap(A, B) exist-overlap(B, A) co-exist(A, B) disappear-overlap(A, B) disappear-overlap(B, A) A = FE, B = LM Log4J 0.94 0. 15 15 1 0 Jmol 1 0 27 0 0 JFreechart 0.92 0.1 22 0.14 0 A = FE, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = FE, B = GC Log4J 0.44 0.16 7 0 0 Jmol 0.85 0.27 28 0.17 0 JFreechart 0.76 0.17 16 0 0 A = GC, B = LM Log4J 0.75 0.34 33 0 0 Jmol 0.83 0.51 82 0.27 0.39 JFreechart 0.75 0.4 73 0 0.06 A = GC, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 A = LM, B = TC Log4J 0 0 0 0 0 Jmol 0 0 0 0 0 JFreechart 0 0 0 0 0 is difference between exist-overlaps is lower (40%, 30%, 5%) for god classes co-existing with long methods, so it cult to decide whether god classes support long methods there is no reason for methods that should be implemente the template or the strategy pattern to be longer, requir services of classes other than its own, or be located in -/->
  • 42.
  • 43.
    Conclusions • If TCthen neither LM, FE or GC. If LM, FE or GC then there is not TC. • GC indicates LM and FE. • FE only occurs in LM LM FE TC GC LM <== <-/- <—> FE <-/- <— TC -/-> GC a —> b Plain support a <—> b Mutual support a -/-> b Rejection !a —> !b Common refactoringa ==> b Inclusion FE: Feature Envy LM: Long Method TC: Type Checking GC: God Class Conventions Read the table in this direction
  • 44.
    Conclusions • If TCthen neither LM, FE or GC. If LM, FE or GC then there is not TC. • GC indicates LM and FE. • FE only occurs in LM LM FE TC GC LM <== <-/- <—> FE <-/- <— TC -/-> GC GC LM FE TC Detection a —> b Plain support a <—> b Mutual support a -/-> b Rejection !a —> !b Common refactoringa ==> b Inclusion FE: Feature Envy LM: Long Method TC: Type Checking GC: God Class Conventions Read the table in this direction
  • 45.
    Conclusions • If TCthen neither LM, FE or GC. If LM, FE or GC then there is not TC. • GC indicates LM and FE. • FE only occurs in LM LM FE TC GC LM <== <-/- <—> FE <-/- <— TC -/-> GC GC LM FE TC Detection FE LM GC TCRemoval a —> b Plain support a <—> b Mutual support a -/-> b Rejection !a —> !b Common refactoringa ==> b Inclusion FE: Feature Envy LM: Long Method TC: Type Checking GC: God Class Conventions Read the table in this direction