Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Visually Localizing Design Problems with

Disharmony Maps


            Richard Wettel and Michele Lanza
                 ...
Overview




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   2
Overview




  Software
   design

Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony ...
Overview




  Software                         Code
   design                          cities

Richard Wettel and Michele...
Overview




  Software                         Code             Disharmony
   design                          cities     ...
Overview




  Software                         Code             Disharmony   Tool
   design                          citi...
On software design
Research around software design




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony...
Research around software design
 Concepts
        heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al....
Research around software design
 Concepts
        heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al....
Research around software design
 Concepts
        heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al....
Research around software design
 Concepts
        heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al....
Design disharmony




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   5
Design disharmony                                            God Class
                                                   ...
Intensive Coupling
Design disharmony                                          God Class
                                  ...
Intensive Coupling
Design disharmony                                     God Class
                                       ...
Intensive Coupling
Design disharmony                                          God Class
                                  ...
Definition of God Class

             “In a good object-oriented design
             the intelligence of a system is
      ...
Characteristics of a God Class




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony ...
Characteristics of a God Class
                 Heavily accesses data
                 of other “lightweight”
            ...
Characteristics of a God Class
                 Heavily accesses data
                 of other “lightweight”
            ...
Characteristics of a God Class
                 Heavily accesses data
                 of other “lightweight”
            ...
Characteristics of a God Class
                 Heavily accesses data
                 of other “lightweight”
            ...
The God Class detection strategy




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmon...
Software systems as cities
The city metaphor




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   10
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
The city metaphor
   domain mapping

   class              building

   package            district

   system            ...
“Reading” a code city (ArgoUML)




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony...
“Reading” a code city (ArgoUML)
                 skyscrapers
                  (NOM, NOA)




Richard Wettel and Michele L...
“Reading” a code city (ArgoUML)
                 skyscrapers
                  (NOM, NOA)




parking lots
 (NOM, NOA)
Ric...
“Reading” a code city (ArgoUML)
                 skyscrapers
                  (NOM, NOA)




                            ...
Cities of the Java case studies




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony...
Cities of the Java case studies
                                                           System           NOP         NO...
Cities of the Java case studies
                                                           System           NOP         NO...
Cities of the Java case studies
                                                           System           NOP         NO...
Cities of the Java case studies
                                                           System           NOP         NO...
Cities of the Java case studies
                                                           System           NOP         NO...
Cities of the Java case studies
                                                           System           NOP         NO...
Disharmony maps
Inspired by health maps




                                   World distribution of Myxobolus cerebralis

Richard Wettel ...
Disharmony map: focus+context




God classes
 of JDK 1.5
Richard Wettel and Michele Lanza   Visually Localizing Design Pr...
JDK’s disharmony map




      12 Brain classes
 16
      65 God classes
      109   Data classes

Richard Wettel and Mich...
JDK’s disharmony map
Component
NOA 88, NOM 280




      12 Brain classes
 16
      65 God classes
      109   Data classe...
JDK’s disharmony map
                                                                       Security
                     ...
JDK’s disharmony map




      12 Brain classes
 16
      65 God classes
      109   Data classes
                        ...
JDK’s disharmony map




      12 Brain classes
 16
      65 God classes                                     KeyEvent
    ...
JDK’s disharmony map




                                                                      InputEvent
      12 Brain c...
JDK’s disharmony map




java.awt.geom




      12 Brain classes
 16
      65 God classes
      109   Data classes

Richa...
ArgoUML’s disharmony map
       8 Brain classes
  9
      24 God classes
      17 Data classes




Richard Wettel and Mich...
ArgoUML’s disharmony map
       8 Brain classes             FacadeMDRImpl                              Facade
  9         ...
Granularity of representation

        class C
                                       NOM = 7
                            ...
Granularity of representation

        class C
                                       NOM = 7
                            ...
Granularity of representation

        class C
                                       NOM = 7




                        ...
Granularity of representation

        class C
                                                                           ...
Feature envy map of Jmol
        Feature envy




Richard Wettel and Michele Lanza   Visually Localizing Design Problems w...
Feature envy map of Jmol
        Feature envy




   1,500 methods (25 %)
Richard Wettel and Michele Lanza   Visually Loca...
Shotgun surgery map of ArgoUML
 Facade                                                         AggregationKind            ...
Tool support
The toolchain




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   22
The toolchain




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   22
The toolchain



                                        Moose

                         parsing




Richard Wettel and Mi...
The toolchain

                          iPlasma

               parsing


                                         Moose
...
The toolchain

                                      model
                          iPlasma
                             ...
The toolchain

                                      model
                          iPlasma
                             ...
Demo time!




Richard Wettel and Michele Lanza   Visually Localizing Design Problems with Disharmony Maps   23
Closing remarks




 Design disharmonies overview actual design
 problems in context.



www.inf.unisi.ch/phd/wettel/codec...
Closing remarks

                                   +                                   =


 Design disharmonies overview ...
Closing remarks

                                   +                                   =


 Design disharmonies overview ...
Richard Wettel
http://www.inf.unisi.ch/phd/wettel




 http://creativecommons.org/licenses/by/3.0/
Nächste SlideShare
Wird geladen in …5
×

Visually Localizing Design Problems with Disharmony Maps

7.957 Aufrufe

Veröffentlicht am

Localizing design problems in a code city, by mapping the results of detection strategies. Presented at Softvis 2008 (Herrsching, Germany), September 2008.

Veröffentlicht in: Technologie, Design
  • Als Erste(r) kommentieren

Visually Localizing Design Problems with Disharmony Maps

  1. 1. Visually Localizing Design Problems with Disharmony Maps Richard Wettel and Michele Lanza REVEAL @ Faculty of Informatics, University of Lugano, Switzerland
  2. 2. Overview Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 2
  3. 3. Overview Software design Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 2
  4. 4. Overview Software Code design cities Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 2
  5. 5. Overview Software Code Disharmony design cities maps Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 2
  6. 6. Overview Software Code Disharmony Tool design cities maps support Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 2
  7. 7. On software design
  8. 8. Research around software design Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 4
  9. 9. Research around software design Concepts heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al. 1995], design harmony [Lanza & Marinescu 2006] Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 4
  10. 10. Research around software design Concepts heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al. 1995], design harmony [Lanza & Marinescu 2006] bad smells [Fowler et al. 1998], design flaws [Marinescu 2002] Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 4
  11. 11. Research around software design Concepts heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al. 1995], design harmony [Lanza & Marinescu 2006] bad smells [Fowler et al. 1998], design flaws [Marinescu 2002] Techniques detection strategies [Marinescu 2002, Lanza & Marinescu 2006] Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 4
  12. 12. Research around software design Concepts heuristics [Riel 2000], principles [Martin 2002], patterns [Gamma et al. 1995], design harmony [Lanza & Marinescu 2006] bad smells [Fowler et al. 1998], design flaws [Marinescu 2002] Techniques detection strategies [Marinescu 2002, Lanza & Marinescu 2006] Visualizations quality [Panas et al. 2005], principle violations [Langelier et al. 2005] Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 4
  13. 13. Design disharmony Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 5
  14. 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. 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. 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. 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. 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. 19. Characteristics of a God Class Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 7
  20. 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. 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. 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. 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. 24. The God Class detection strategy Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 8
  25. 25. Software systems as cities
  26. 26. The city metaphor Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 10
  27. 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. 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. 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. 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. 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. 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. 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. 34. “Reading” a code city (ArgoUML) Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
  35. 35. “Reading” a code city (ArgoUML) skyscrapers (NOM, NOA) Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 11
  36. 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. 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. 38. Cities of the Java case studies Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 12
  39. 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. 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. 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. 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. 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. 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
  45. 45. Disharmony maps
  46. 46. Inspired by health maps World distribution of Myxobolus cerebralis Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 14
  47. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 61. Feature envy map of Jmol Feature envy Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 19
  62. 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. 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
  64. 64. Tool support
  65. 65. The toolchain Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
  66. 66. The toolchain Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
  67. 67. The toolchain Moose parsing Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
  68. 68. The toolchain iPlasma parsing Moose parsing Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
  69. 69. The toolchain model iPlasma exchange parsing Moose parsing Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 22
  70. 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. 71. Demo time! Richard Wettel and Michele Lanza Visually Localizing Design Problems with Disharmony Maps 23
  72. 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. 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. 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
  75. 75. Richard Wettel http://www.inf.unisi.ch/phd/wettel http://creativecommons.org/licenses/by/3.0/

×