Localizing design problems in a code city, by mapping the results of detection strategies. Presented at Softvis 2008 (Herrsching, Germany), September 2008.
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Visually Localizing Design Problems with Disharmony Maps
1. Visually Localizing Design Problems with
Disharmony Maps
Richard Wettel and Michele Lanza
REVEAL @ Faculty of Informatics,
University of Lugano, Switzerland
14. Design disharmony God Class
Brain Class
1.Identity
Data Class
How do I
define Brain Method
myself?
Feature Envy
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 5
15. Intensive Coupling
Design disharmony God Class
Dispersive Coupling
Brain Class
1.Identity Shotgun Surgery
Data Class
How do I
2.Collaboration interact with Brain Method
others?
Feature Envy
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 5
16. Intensive Coupling
Design disharmony God Class
Dispersive Coupling
Brain Class
1.Identity Shotgun Surgery
How do I define Data Class
2.Collaboration myself with respect Futile Hierarchy
to my ancestors andBrain Method
descendants? Tradition Breaker
3.Classification Feature Envy
Refused Parent Bequest
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 5
17. Intensive Coupling
Design disharmony God Class
Dispersive Coupling
Brain Class
Shotgun Surgery
Data Class
Futile Hierarchy
Brain Method
Tradition Breaker
Feature Envy
Refused Parent Bequest
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 5
18. Definition of God Class
“In a good object-oriented design
the intelligence of a system is
uniformly distributed among the
top-level classes.”
[Riel 1996]
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 6
19. Characteristics of a God Class
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
20. Characteristics of a God Class
Heavily accesses data
of other “lightweight”
classes,either
directly or using
accessor
methods.
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
21. Characteristics of a God Class
Heavily accesses data
of other “lightweight”
classes,either
directly or using Is large
accessor
methods.
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
22. Characteristics of a God Class
Heavily accesses data
of other “lightweight”
classes,either
directly or using Is large
accessor
methods.
Has a lot of
non-communicative
behavior
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
23. Characteristics of a God Class
Heavily accesses data
of other “lightweight”
classes,either
directly or using Is large
accessor
methods. God
Class
Has a lot of
non-communicative
behavior
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
24. The God Class detection strategy
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 8
26. The city metaphor
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
27. The city metaphor
domain mapping
class building
package district
system city
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
28. The city metaphor
domain mapping
class building
package district
system city
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
29. The city metaphor
domain mapping
class building
package district
system city
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
30. The city metaphor
domain mapping
class building
package district
system city
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
31. The city metaphor
domain mapping
class building
package district
system city
number of methods (NOM) height
number of attributes (NOA) base size
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
32. The city metaphor
domain mapping
class building
package district
system city
nesting level color
number of methods (NOM) height
number of attributes (NOA) base size
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
33. The city metaphor
domain mapping
class building
package district
system city
nesting level color
number of methods (NOM) height
[Wettel & Lanza, ICPC 2007]
[Wettel & Lanza, VISSOFT 2007] number of attributes (NOA) base size
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
34. “Reading” a code city (ArgoUML)
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
35. “Reading” a code city (ArgoUML)
skyscrapers
(NOM, NOA)
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
36. “Reading” a code city (ArgoUML)
skyscrapers
(NOM, NOA)
parking lots
(NOM, NOA)
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
37. “Reading” a code city (ArgoUML)
skyscrapers
(NOM, NOA)
office buildings
parking lots
(NOM, NOA)
(NOM, NOA)
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
38. Cities of the Java case studies
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
39. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
40. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
41. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
42. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
43. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
44. Cities of the Java case studies
System NOP NOC LOC
ArgoUML 144 2,542 137,000
JHotDraw 72 998 30,000
iText 149 1,250 80,000
Jmol 105 1,032 85,000
JDK 1.5 137 4,715 160,000
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
46. Inspired by health maps
World distribution of Myxobolus cerebralis
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 14
47. Disharmony map: focus+context
God classes
of JDK 1.5
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 15
48. JDK’s disharmony map
12 Brain classes
16
65 God classes
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
49. JDK’s disharmony map
Component
NOA 88, NOM 280
12 Brain classes
16
65 God classes
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
50. JDK’s disharmony map
Security
NOA 3, NOM 30
12 Brain classes
16
65 God classes
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
51. JDK’s disharmony map
12 Brain classes
16
65 God classes
109 Data classes
java.awt.event
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
52. JDK’s disharmony map
12 Brain classes
16
65 God classes KeyEvent
NOA 205, NOM 18
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
53. JDK’s disharmony map
InputEvent
12 Brain classes NOA 21, NOM 14
16
65 God classes
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
54. JDK’s disharmony map
java.awt.geom
12 Brain classes
16
65 God classes
109 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 16
55. ArgoUML’s disharmony map
8 Brain classes
9
24 God classes
17 Data classes
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 17
56. ArgoUML’s disharmony map
8 Brain classes FacadeMDRImpl Facade
9 NOA 3, NOM 349 NOA 1, NOM 337
24 God classes
17 Data classes
GeneratorPHP4
NOA 4, NOM 33
GeneratorCPP
NOA 34, NOM 100 JavaRecognizer
NOA 79, NOM 176
CPPParser
NOA 85, NOM 204 Modeller
NOA 15, NOM 52
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 17
57. Granularity of representation
class C
NOM = 7
2
A=
NOA
NO
=2
coarse
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 18
58. Granularity of representation
class C
NOM = 7
2
A=
NOA
NO
=2
coarse fine-grained
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 18
59. Granularity of representation
class C
NOM = 7
las sC
c
2
A=
NOA
NO
=2
coarse fine-grained
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 18
60. Granularity of representation
class C
m6
NOM = 7
m5 m7
m2
m1
m3
m4
las sC
c
2
A=
NOA
NO
=2
coarse fine-grained
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 18
61. Feature envy map of Jmol
Feature envy
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 19
62. Feature envy map of Jmol
Feature envy
1,500 methods (25 %)
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 19
63. Shotgun surgery map of ArgoUML
Facade AggregationKind VisibilityKind
NOM 140/337 NOM 3/3 NOM 4/4
PseudostateKind
NOM 6/6
Model
NOM 28/44
Shotgun surgery
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 20
67. The toolchain
Moose
parsing
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
68. The toolchain
iPlasma
parsing
Moose
parsing
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
69. The toolchain
model
iPlasma
exchange
parsing
Moose
parsing
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
70. The toolchain
model
iPlasma
exchange
parsing
Moose
parsing
OpenGL rendering
CodeCity
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
71. Demo time!
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 23
72. Closing remarks
Design disharmonies overview actual design
problems in context.
www.inf.unisi.ch/phd/wettel/codecity.html
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 24
73. Closing remarks
+ =
Design disharmonies overview actual design
problems in context.
www.inf.unisi.ch/phd/wettel/codecity.html
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 24
74. Closing remarks
+ =
Design disharmonies overview actual design
problems in context.
Acknowledgments:
www.inf.unisi.ch/phd/wettel/codecity.html
Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 24