Bilal Karasneh, Michel R.V. Chaudron,
Foutse Khomh, and Yann-Gaël Guéhéneuc
This work is licensed under a Creative
Commons Attribution-NonCommercial-
ShareAlike 3.0 Unported License
Studying the Relation between
Anti-patterns in Design
Models and in Source Code
2016/03/16
2/27
Stir your interest for
research on the relations
between models and
corresponding source code
3/27
Context and Main Question
 Software engineers use models to describe
and reflect upon their software systems
– Even more true with model-driven engineering
 What is the impact of the quality of models
on the quality of the source code?
4/27
Software Quality
 Proxies
– Design anti-patterns
– Number of changes
– Number of faults
– Cyclomatic complexity and LOC
5/27
Questions
 Do the very design of the systems lead to
the occurrences of anti-patterns or are anti-
patterns introduced during implementation?
– Do anti-patterns occurring in models also occur
in the source code?
– What is the impact of the anti-patterns occurring
in models on the classes in the source code?
6/27
Needs
 Software development design models
 Matching between models and source code
 Anti-patterns in models and in the code
 Fault, change, and metric data
7/27
Needs
 Software development design models
– UML Repository: http://models-db.com
8/27
Needs
 Matching between models and source code
– One to many relations
– Names and semantics
 Manual analysis
9/27
Needs
 Anti-patterns in models and in the code
– Ptidej Tool Suite: http://wiki.ptidej.net
10/27
Needs
 Fault, change, and metric data
– IBDOOS, http://www.ptidej.net
– Ptidej Tool Suite
+
11/27
Source code
repository
Antipatterns
detection
PTIDEJ
Analyses
Anti-patterns
detection
PTIDEJ
UML models
repository
Approach
Bug
information
IBDOOS
Bugzilla
12/27
Programs Descriptions URLs
Annoyme Adds beautiful typewriter sounds to Desktop keyboards github.com/dedeibel/annoyme
ArgoUML An open source UML modeling tool argouml.sourceforge.net
JCoAP Java implementation of the Constrained Application Protocol github.com/dapaulid/JCoAP
JGAP Package of Genetic Algorithm and Genetic Programming jgap.sourceforge.net
Kartjax Cross-platform, tools to create object, animation and map code.google.com/p/kartjax/
Mars Simulation Project to create a simulation of future settlements on Mars mars-sim.sourceforge.net
Msv Poker Poker Game (poker server and poker client) github.com/mihhailnovik/msvPoker
Neuroph Lightweight neural network framework neuroph.sourceforge.net
Syntax-analyzer Syntax analyzer for (*.lng) file github.com/myzone/syntax-analyzer/
Wro4j Web resource optimizer for Java code.google.com/p/wro4j
Data Collection
 Ten open-source software projects
13/27
Data Collection
 Detected anti-patterns
– Complex classes
– Large classes
– Lazy classes
– Blob
– Classes with data that should be private
– Classes refusing parents’ bequests
– Base classes that should be abstract
14/27
Research Questions
RQ1: Do anti-patterns occurring in
models also occur in the source code?
RQ2: What is the impact of anti-patterns
from models on classes in code?
15/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Transfer of anti-patterns from models to code
Programs
# Anti-patterns
in models
# Anti-patterns
in source code
Proportions of same classes
with same anti-patterns in
models and source code
Annoyme 10 5 0.50
ArgoUML 18 10 0.56
JCoAP 4 3 0.75
JGAP 13 5 0.38
Kartjax 17 1 0.06
Mars_Simulation 22 3 0.14
Msv_Poker 11 4 0.36
Neuroph 12 4 0.33
Syntax-analyzer 9 1 0.11
Wro4j 25 12 0.48
Average 0.37
16/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
17/27
37% of the classes in the models that have
anti-patterns exist in the source code with
the same anti-patterns
RQ1: Do anti-patterns occurring in
models also occur in the source code?
18/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Modeled classes
– Classes that are in the models and in the code
 Non-modeled classes
– Classes that are not in the models
Programs # Versions
Modeled
classes
Non-modeled
classes
Total
ArgoUML 9 88 2,731 2,819
Wro4j 6 197 876 1,073
19/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Numbers of changes, faults
Programs Categories Means
Changes
ArgoUML
Modeled classes 22
Non-modeled classes 7.78
Wro4j
Modeled classes 15.17
Non-modeled classes 6.56
Programs Categories Means
Faults
ArgoUML
Modeled classes 0.82
Non-modeled classes 0.42
Wro4j
Modeled classes 2.91
Non-modeled classes 1.04
20/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Changes, Faults vs. LOC, complexity
Programs Categories
Correlations
R2
AvgCyc LOC
Changes
ArgoUML
Modeled classes 0.30 0.74 0.54
Non-modeled classes 0.21 0.43 0.19
Wro4j
Modeled classes 0.06 0.62 0.39
Non-modeled classes -0.00 0.38 0.17
Programs Categories
Correlations
R2
AvgCyc LOC
Faults
ArgoUML
Modeled classes 0.35 0.53 0.32
Non-Modeled classes 0.13 0.26 0.07
Wro4j
Modeled classes 0.02 0.60 0.35
Non-Modeled classes -0.01 0.40 0.18
21/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Number of changes, faults
Programs Categories Means
Changes
ArgoUML
Anti-patterns classes 30.80
No-anti-patterns classes 06.59
Wro4j
Anti-patterns classes 16.60
No-anti-patterns classes 12.26
Programs Categories Means
Faults
ArgoUML
Anti-patterns classes 1.20
No-anti-patterns classes 0.15
Wro4j
Anti-patterns classes 3.16
No-anti-patterns classes 2.38
22/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Anti- and no-anti-patterns vs. LOC, complexity
Programs Categories
Correlations
R2
AvgCyc LOC
Changes
ArgoUML
Anti-patterns classes 0.41 0.67 0.44
No-anti-patterns classes 0.33 0.85 0.72
Wro4j
Anti-patterns classes 0.06 0.59 0.35
No-anti-patterns classes 0.02 0.70 0.48
Programs Categories
Correlations
R2
AvgCyc LOC
Faults
ArgoUML
Anti-patterns classes 0.48 0.61 0.42
No-anti-patterns classes 0.35 0.65 0.65
Wro4j
Anti-patterns classes -0.01 0.49 0.49
No-anti-patterns classes 0.01 0.70 0.48
23/27
Modeled classes with anti-patterns have
more changes and faults in the source code
RQ2: What is the impact of anti-patterns
from models on classes in code?
24/27
Take Home
 Anti-patterns appear in models…
37% of the classes in the models that have anti-
patterns exist in the source code with the same
anti-patterns
… and impact source code
Classes in the models that have anti-patterns
have more changes and faults in source code
25/27
Take Home
 Anti-patterns must be detected early
– Avoid transfer to the source code
– Reduce number of changes/faults in code
 We expect that other problems in the models
can propagate to the source code
26/27
Interesting Future
 Automate matching of classes
 Measure distance btw. models, source code
 Analyse more pairs of models, source code
 Analyse more programs
 Link model and source code refactorings
 Propose prevention techniques
27/27
Stir your interest for
research on the relations
between models and
corresponding source code
28/27
29/27
Data Collection
 Relation between models and source code
Programs
# Classes in
Models
# Classes in
source code
Proportions
Annoyme 17 59 0.29
ArgoUML 51 909 0.03
JCoAP 21 52 0.40
JGAP 19 191 0.10
Kartjax 29 36 0.80
Mars_Simulation 32 953 0.03
Msv_Poker 22 55 0.40
Neuroph 26 179 0.15
Syntax-analyzer 26 34 0.76
Wro4j 28 289 0.10
30/27
Data Collection
 Relation between models and source code
Programs
# Classes
existing in
models and
source code
Proportions in both
models and source
code wrt. models
Proportion in both
models and source
code wrt. code
Annoyme 14 0.82 0.24
ArgoUML 44 0.86 0.05
JCoAP 3 0.14 0.06
JGAP 18 0.95 0.09
Kartjax 1 0.03 0.03
Mars_Simulation 29 0.91 0.03
Msv_Poker 13 0.59 0.24
Neuroph 24 0.92 0.13
Syntax-analyzer 1 0.04 0.03
Wro4j 11 0.39 0.011
31/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Anti-patterns in models and source code
Programs
# Anti-patterns
in Models
# Anti-patterns in
source code
# Same anti-patterns in
the same classes in
models and source code
Annoyme 10 16 5
ArgoUML 18 524 10
JCoAP 4 2 3
JGAP 13 252 5
Kartjax 17 4 1
Mars_Simulation 22 370 3
Msv_Poker 11 18 4
Neuroph 12 41 4
Syntax-analyzer 9 5 1
Wro4j 25 215 12
32/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Anti-patterns in models and source code
Programs
# Anti-patterns
in Models
# Anti-patterns in
source code
# Same anti-patterns in
the same classes in
models and source code
Annoyme 10 16 5
ArgoUML 18 524 10
JCoAP 4 2 3
JGAP 13 252 5
Kartjax 17 4 1
Mars_Simulation 22 370 3
Msv_Poker 11 18 4
Neuroph 12 41 4
Syntax-analyzer 9 5 1
Wro4j 25 215 12
33/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Anti-patterns in models and source code
– Some anti-patterns exist in both models and
source code, in the same classes
– JCoAP, Kartjax, and Syntax-analyzer
• Smallest systems
• Models are likely outdated
– In future work, measure the distance between
the models and the source code
34/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Few occurrences in design
– Designers avoid complex classes
– Methods are complex to implement
– Developers do not follow the design
35/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Large classes are rare in models
– Designers focus on the “principles” of classes
– Developers lack time to introduce proper
abstractions and “grow” classes
36/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Most frequent anti-patterns
– Designers try to anticipate future evolutions
– Developers remove excessive abstractions
37/27
Do Anti-patterns Occurring in Models
Also Occur in the Source Code?
 Long methods are only in the source code
– Designs do not contains all details
– Developers implement features under time
pressure and little incentive to refactor
38/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Modeled classes
– Classes that are in the models and in the code
 Non-modeled classes
– Classes that are not in the models
Programs # Versions
Modeled
classes
Non-modeled
classes
Total
ArgoUML 9 88 2,731 2,819
Wro4j 6 197 876 1,073
39/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Numbers of changes, faults
Programs Categories Means
Changes
ArgoUML
Modeled classes 22
Non-modeled classes 7.78
Wro4j
Modeled classes 15.17
Non-modeled classes 6.56
Programs Categories Means
Faults
ArgoUML
Modeled classes 0.82
Non-modeled classes 0.42
Wro4j
Modeled classes 2.91
Non-modeled classes 1.04
40/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 There are significant differences between
modeled and non-modeled classes
– Classes in models describe core classes of the
source code, so they change more
– More changes leads to more faults
– Design problems could transferred to the code
41/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Changes, Faults vs. LOC, complexity
Programs Categories
Correlations
R2
AvgCyc LOC
Changes
ArgoUML
Modeled classes 0.30 0.74 0.54
Non-modeled classes 0.21 0.43 0.19
Wro4j
Modeled classes 0.06 0.62 0.39
Non-modeled classes -0.00 0.38 0.17
Programs Categories
Correlations
R2
AvgCyc LOC
Faults
ArgoUML
Modeled classes 0.35 0.53 0.32
Non-Modeled classes 0.13 0.26 0.07
Wro4j
Modeled classes 0.02 0.60 0.35
Non-Modeled classes -0.01 0.40 0.18
42/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 There are significant differences between
modeled and non-modeled classes
– Modeled classes that have higher LOC have
more changes and faults
– AvgCyc does not have any correlations with
modeled, non-modeled classes
43/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Number of changes, faults
Programs Categories Means
Changes
ArgoUML
Anti-patterns classes 30.80
No-anti-patterns classes 06.59
Wro4j
Anti-patterns classes 16.60
No-anti-patterns classes 12.26
Programs Categories Means
Faults
ArgoUML
Anti-patterns classes 1.20
No-anti-patterns classes 0.15
Wro4j
Anti-patterns classes 3.16
No-anti-patterns classes 2.38
44/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 There are significant differences between
classes with/out anti-patterns in numbers of
changes and faults
– Modeled classes with anti-patterns have more
changes and faults in the source code
– Design problems must be fixed quickly, else
they propagate from models to source code,
causing changes and faults
45/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 Anti- and no-anti-patterns vs. LOC, complexity
Programs Categories
Correlations
R2
AvgCyc LOC
Changes
ArgoUML
Anti-patterns classes 0.41 0.67 0.44
No-anti-patterns classes 0.33 0.85 0.72
Wro4j
Anti-patterns classes 0.06 0.59 0.35
No-anti-patterns classes 0.02 0.70 0.48
Programs Categories
Correlations
R2
AvgCyc LOC
Faults
ArgoUML
Anti-patterns classes 0.48 0.61 0.42
No-anti-patterns classes 0.35 0.65 0.65
Wro4j
Anti-patterns classes -0.01 0.49 0.49
No-anti-patterns classes 0.01 0.70 0.48
46/27
What is the Impact of Anti-patterns
from Models on Classes in Code?
 # Changes have significantly higher
correlations with LOC in no-anti-pattern
classes than anti-patterns classes
 # Changes and # Faults do not have strong
correlations with LOC in anti-pattern classes
– Changes/Faults exist no matter the class sizes

Saner16b.ppt

  • 1.
    Bilal Karasneh, MichelR.V. Chaudron, Foutse Khomh, and Yann-Gaël Guéhéneuc This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported License Studying the Relation between Anti-patterns in Design Models and in Source Code 2016/03/16
  • 2.
    2/27 Stir your interestfor research on the relations between models and corresponding source code
  • 3.
    3/27 Context and MainQuestion  Software engineers use models to describe and reflect upon their software systems – Even more true with model-driven engineering  What is the impact of the quality of models on the quality of the source code?
  • 4.
    4/27 Software Quality  Proxies –Design anti-patterns – Number of changes – Number of faults – Cyclomatic complexity and LOC
  • 5.
    5/27 Questions  Do thevery design of the systems lead to the occurrences of anti-patterns or are anti- patterns introduced during implementation? – Do anti-patterns occurring in models also occur in the source code? – What is the impact of the anti-patterns occurring in models on the classes in the source code?
  • 6.
    6/27 Needs  Software developmentdesign models  Matching between models and source code  Anti-patterns in models and in the code  Fault, change, and metric data
  • 7.
    7/27 Needs  Software developmentdesign models – UML Repository: http://models-db.com
  • 8.
    8/27 Needs  Matching betweenmodels and source code – One to many relations – Names and semantics  Manual analysis
  • 9.
    9/27 Needs  Anti-patterns inmodels and in the code – Ptidej Tool Suite: http://wiki.ptidej.net
  • 10.
    10/27 Needs  Fault, change,and metric data – IBDOOS, http://www.ptidej.net – Ptidej Tool Suite +
  • 11.
  • 12.
    12/27 Programs Descriptions URLs AnnoymeAdds beautiful typewriter sounds to Desktop keyboards github.com/dedeibel/annoyme ArgoUML An open source UML modeling tool argouml.sourceforge.net JCoAP Java implementation of the Constrained Application Protocol github.com/dapaulid/JCoAP JGAP Package of Genetic Algorithm and Genetic Programming jgap.sourceforge.net Kartjax Cross-platform, tools to create object, animation and map code.google.com/p/kartjax/ Mars Simulation Project to create a simulation of future settlements on Mars mars-sim.sourceforge.net Msv Poker Poker Game (poker server and poker client) github.com/mihhailnovik/msvPoker Neuroph Lightweight neural network framework neuroph.sourceforge.net Syntax-analyzer Syntax analyzer for (*.lng) file github.com/myzone/syntax-analyzer/ Wro4j Web resource optimizer for Java code.google.com/p/wro4j Data Collection  Ten open-source software projects
  • 13.
    13/27 Data Collection  Detectedanti-patterns – Complex classes – Large classes – Lazy classes – Blob – Classes with data that should be private – Classes refusing parents’ bequests – Base classes that should be abstract
  • 14.
    14/27 Research Questions RQ1: Doanti-patterns occurring in models also occur in the source code? RQ2: What is the impact of anti-patterns from models on classes in code?
  • 15.
    15/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Transfer of anti-patterns from models to code Programs # Anti-patterns in models # Anti-patterns in source code Proportions of same classes with same anti-patterns in models and source code Annoyme 10 5 0.50 ArgoUML 18 10 0.56 JCoAP 4 3 0.75 JGAP 13 5 0.38 Kartjax 17 1 0.06 Mars_Simulation 22 3 0.14 Msv_Poker 11 4 0.36 Neuroph 12 4 0.33 Syntax-analyzer 9 1 0.11 Wro4j 25 12 0.48 Average 0.37
  • 16.
    16/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?
  • 17.
    17/27 37% of theclasses in the models that have anti-patterns exist in the source code with the same anti-patterns RQ1: Do anti-patterns occurring in models also occur in the source code?
  • 18.
    18/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Modeled classes – Classes that are in the models and in the code  Non-modeled classes – Classes that are not in the models Programs # Versions Modeled classes Non-modeled classes Total ArgoUML 9 88 2,731 2,819 Wro4j 6 197 876 1,073
  • 19.
    19/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Numbers of changes, faults Programs Categories Means Changes ArgoUML Modeled classes 22 Non-modeled classes 7.78 Wro4j Modeled classes 15.17 Non-modeled classes 6.56 Programs Categories Means Faults ArgoUML Modeled classes 0.82 Non-modeled classes 0.42 Wro4j Modeled classes 2.91 Non-modeled classes 1.04
  • 20.
    20/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Changes, Faults vs. LOC, complexity Programs Categories Correlations R2 AvgCyc LOC Changes ArgoUML Modeled classes 0.30 0.74 0.54 Non-modeled classes 0.21 0.43 0.19 Wro4j Modeled classes 0.06 0.62 0.39 Non-modeled classes -0.00 0.38 0.17 Programs Categories Correlations R2 AvgCyc LOC Faults ArgoUML Modeled classes 0.35 0.53 0.32 Non-Modeled classes 0.13 0.26 0.07 Wro4j Modeled classes 0.02 0.60 0.35 Non-Modeled classes -0.01 0.40 0.18
  • 21.
    21/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Number of changes, faults Programs Categories Means Changes ArgoUML Anti-patterns classes 30.80 No-anti-patterns classes 06.59 Wro4j Anti-patterns classes 16.60 No-anti-patterns classes 12.26 Programs Categories Means Faults ArgoUML Anti-patterns classes 1.20 No-anti-patterns classes 0.15 Wro4j Anti-patterns classes 3.16 No-anti-patterns classes 2.38
  • 22.
    22/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Anti- and no-anti-patterns vs. LOC, complexity Programs Categories Correlations R2 AvgCyc LOC Changes ArgoUML Anti-patterns classes 0.41 0.67 0.44 No-anti-patterns classes 0.33 0.85 0.72 Wro4j Anti-patterns classes 0.06 0.59 0.35 No-anti-patterns classes 0.02 0.70 0.48 Programs Categories Correlations R2 AvgCyc LOC Faults ArgoUML Anti-patterns classes 0.48 0.61 0.42 No-anti-patterns classes 0.35 0.65 0.65 Wro4j Anti-patterns classes -0.01 0.49 0.49 No-anti-patterns classes 0.01 0.70 0.48
  • 23.
    23/27 Modeled classes withanti-patterns have more changes and faults in the source code RQ2: What is the impact of anti-patterns from models on classes in code?
  • 24.
    24/27 Take Home  Anti-patternsappear in models… 37% of the classes in the models that have anti- patterns exist in the source code with the same anti-patterns … and impact source code Classes in the models that have anti-patterns have more changes and faults in source code
  • 25.
    25/27 Take Home  Anti-patternsmust be detected early – Avoid transfer to the source code – Reduce number of changes/faults in code  We expect that other problems in the models can propagate to the source code
  • 26.
    26/27 Interesting Future  Automatematching of classes  Measure distance btw. models, source code  Analyse more pairs of models, source code  Analyse more programs  Link model and source code refactorings  Propose prevention techniques
  • 27.
    27/27 Stir your interestfor research on the relations between models and corresponding source code
  • 28.
  • 29.
    29/27 Data Collection  Relationbetween models and source code Programs # Classes in Models # Classes in source code Proportions Annoyme 17 59 0.29 ArgoUML 51 909 0.03 JCoAP 21 52 0.40 JGAP 19 191 0.10 Kartjax 29 36 0.80 Mars_Simulation 32 953 0.03 Msv_Poker 22 55 0.40 Neuroph 26 179 0.15 Syntax-analyzer 26 34 0.76 Wro4j 28 289 0.10
  • 30.
    30/27 Data Collection  Relationbetween models and source code Programs # Classes existing in models and source code Proportions in both models and source code wrt. models Proportion in both models and source code wrt. code Annoyme 14 0.82 0.24 ArgoUML 44 0.86 0.05 JCoAP 3 0.14 0.06 JGAP 18 0.95 0.09 Kartjax 1 0.03 0.03 Mars_Simulation 29 0.91 0.03 Msv_Poker 13 0.59 0.24 Neuroph 24 0.92 0.13 Syntax-analyzer 1 0.04 0.03 Wro4j 11 0.39 0.011
  • 31.
    31/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Anti-patterns in models and source code Programs # Anti-patterns in Models # Anti-patterns in source code # Same anti-patterns in the same classes in models and source code Annoyme 10 16 5 ArgoUML 18 524 10 JCoAP 4 2 3 JGAP 13 252 5 Kartjax 17 4 1 Mars_Simulation 22 370 3 Msv_Poker 11 18 4 Neuroph 12 41 4 Syntax-analyzer 9 5 1 Wro4j 25 215 12
  • 32.
    32/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Anti-patterns in models and source code Programs # Anti-patterns in Models # Anti-patterns in source code # Same anti-patterns in the same classes in models and source code Annoyme 10 16 5 ArgoUML 18 524 10 JCoAP 4 2 3 JGAP 13 252 5 Kartjax 17 4 1 Mars_Simulation 22 370 3 Msv_Poker 11 18 4 Neuroph 12 41 4 Syntax-analyzer 9 5 1 Wro4j 25 215 12
  • 33.
    33/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Anti-patterns in models and source code – Some anti-patterns exist in both models and source code, in the same classes – JCoAP, Kartjax, and Syntax-analyzer • Smallest systems • Models are likely outdated – In future work, measure the distance between the models and the source code
  • 34.
    34/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Few occurrences in design – Designers avoid complex classes – Methods are complex to implement – Developers do not follow the design
  • 35.
    35/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Large classes are rare in models – Designers focus on the “principles” of classes – Developers lack time to introduce proper abstractions and “grow” classes
  • 36.
    36/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Most frequent anti-patterns – Designers try to anticipate future evolutions – Developers remove excessive abstractions
  • 37.
    37/27 Do Anti-patterns Occurringin Models Also Occur in the Source Code?  Long methods are only in the source code – Designs do not contains all details – Developers implement features under time pressure and little incentive to refactor
  • 38.
    38/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Modeled classes – Classes that are in the models and in the code  Non-modeled classes – Classes that are not in the models Programs # Versions Modeled classes Non-modeled classes Total ArgoUML 9 88 2,731 2,819 Wro4j 6 197 876 1,073
  • 39.
    39/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Numbers of changes, faults Programs Categories Means Changes ArgoUML Modeled classes 22 Non-modeled classes 7.78 Wro4j Modeled classes 15.17 Non-modeled classes 6.56 Programs Categories Means Faults ArgoUML Modeled classes 0.82 Non-modeled classes 0.42 Wro4j Modeled classes 2.91 Non-modeled classes 1.04
  • 40.
    40/27 What is theImpact of Anti-patterns from Models on Classes in Code?  There are significant differences between modeled and non-modeled classes – Classes in models describe core classes of the source code, so they change more – More changes leads to more faults – Design problems could transferred to the code
  • 41.
    41/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Changes, Faults vs. LOC, complexity Programs Categories Correlations R2 AvgCyc LOC Changes ArgoUML Modeled classes 0.30 0.74 0.54 Non-modeled classes 0.21 0.43 0.19 Wro4j Modeled classes 0.06 0.62 0.39 Non-modeled classes -0.00 0.38 0.17 Programs Categories Correlations R2 AvgCyc LOC Faults ArgoUML Modeled classes 0.35 0.53 0.32 Non-Modeled classes 0.13 0.26 0.07 Wro4j Modeled classes 0.02 0.60 0.35 Non-Modeled classes -0.01 0.40 0.18
  • 42.
    42/27 What is theImpact of Anti-patterns from Models on Classes in Code?  There are significant differences between modeled and non-modeled classes – Modeled classes that have higher LOC have more changes and faults – AvgCyc does not have any correlations with modeled, non-modeled classes
  • 43.
    43/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Number of changes, faults Programs Categories Means Changes ArgoUML Anti-patterns classes 30.80 No-anti-patterns classes 06.59 Wro4j Anti-patterns classes 16.60 No-anti-patterns classes 12.26 Programs Categories Means Faults ArgoUML Anti-patterns classes 1.20 No-anti-patterns classes 0.15 Wro4j Anti-patterns classes 3.16 No-anti-patterns classes 2.38
  • 44.
    44/27 What is theImpact of Anti-patterns from Models on Classes in Code?  There are significant differences between classes with/out anti-patterns in numbers of changes and faults – Modeled classes with anti-patterns have more changes and faults in the source code – Design problems must be fixed quickly, else they propagate from models to source code, causing changes and faults
  • 45.
    45/27 What is theImpact of Anti-patterns from Models on Classes in Code?  Anti- and no-anti-patterns vs. LOC, complexity Programs Categories Correlations R2 AvgCyc LOC Changes ArgoUML Anti-patterns classes 0.41 0.67 0.44 No-anti-patterns classes 0.33 0.85 0.72 Wro4j Anti-patterns classes 0.06 0.59 0.35 No-anti-patterns classes 0.02 0.70 0.48 Programs Categories Correlations R2 AvgCyc LOC Faults ArgoUML Anti-patterns classes 0.48 0.61 0.42 No-anti-patterns classes 0.35 0.65 0.65 Wro4j Anti-patterns classes -0.01 0.49 0.49 No-anti-patterns classes 0.01 0.70 0.48
  • 46.
    46/27 What is theImpact of Anti-patterns from Models on Classes in Code?  # Changes have significantly higher correlations with LOC in no-anti-pattern classes than anti-patterns classes  # Changes and # Faults do not have strong correlations with LOC in anti-pattern classes – Changes/Faults exist no matter the class sizes