Of Code and Change: Beautiful Software

10,399 views
8,843 views

Published on

A talk I gave at the JAOO 2008 developers conference

Published in: Technology, Business
1 Comment
14 Likes
Statistics
Notes
No Downloads
Views
Total views
10,399
On SlideShare
0
From Embeds
0
Number of Embeds
238
Actions
Shares
0
Downloads
22
Comments
1
Likes
14
Embeds 0
No embeds

No notes for slide

Of Code and Change: Beautiful Software

  1. Of Code and Change: Beautiful Software Michele Lanza REVEAL @ Faculty of Informatics University of Lugano, Switzerland
  2. Of Code and Change: Beautiful Software Michele Lanza REVEAL @ Faculty of Informatics University of Lugano, Switzerland
  3. Beautiful Software Michele Lanza
  4. Prologue Who the heck is this guy?
  5. Michele Lanza
  6. Michele Lanza
  7. Michele Lanza
  8. Michele Lanza
  9. Academic Research
  10. Industrial Reality
  11. Military Research
  12. Part 1 Software Visualization 101
  13. What is Software? [Software is] anything but hardware, meaning that the quot;hardquot; are the parts that are tangible (able to hold) while the quot;softquot; part is the intangible objects inside the computer.
  14. Source Code = Text
  15. Programming = Writing
  16. /***************************************************************************/ if(i<0||E-S&&b[E]&&y-E<2&E-y<2)m=I; /* K capt. or bad castling */ /* micro-Max, */ if(m>=l)goto C; /* abort on fail high */ /* A chess program smaller than 2KB (of non-blank source), by H.G. Muller */ /***************************************************************************/ /* version 3.2 (2000 characters) features: */ /* - recursive negamax search */ /* - quiescence search with recaptures */ /* - recapture extensions */ if(h=d-(y!=z)) /* remaining depth(-recapt.)*/ /* - (internal) iterative deepening */ {v=p<6?b[x+8]-b[y+8]:0; /* center positional pts. */ /* - best-move-first 'sorting' */ b[G]=b[H]=b[x]=0;b[y]=u&31; /* do move, strip virgin-bit*/ /* - a hash table storing score and best move */ if(!(G&M)){b[F]=k+6;v+=30;} /* castling: put R & score */ /* - full FIDE rules (expt minor ptomotion) and move-legality checking */ if(p<3) /* pawns: */ {v-=9*(((x-2)&M||b[x-2]!=u)+ /* structure, undefended */ #define F(I,S,N) for(I=S;I<N;I++) ((x+2)&M||b[x+2]!=u)-1); /* squares plus bias */ #define W(A) while(A) if(y+r+1&S){b[y]|=7;i+=C;} /* promote p to Q, add score*/ #define K(A,B) *(int*)(T+A+(B&8)+S*(B&7)) } #define J(A) K(y+A,b[y])-K(x+A,u)-K(H+A,t) v=-D(24-k,-l-(l>e),m>q?-m:-q,-e-v-i, /* recursive eval. of reply */ J+J(0),Z+J(8)+G-S,F,y,h); /* J,Z: hash keys */ #define U 16777224 v-=v>e; /* delayed-gain penalty */ struct _ {int K,V;char X,Y,D;} A[U]; /* hash table, 16M+8 entries*/ if(z==9) /* called as move-legality */ {if(v!=-I&x==K&y==L) /* checker: if move found */ int V=112,M=136,S=128,I=8e4,C=799,Q,N,i; /* V=0x70=rank mask, M=0x88 */ {Q=-e-i;O=F;return l;} /* & not in check, signal */ v=m; /* (prevent fail-lows on */ char O,K,L, } /* K-capt. replies) */ w[]={0,1,1,3,-1,3,5,9}, /* relative piece values */ b[G]=k+38;b[F]=b[y]=0;b[x]=u;b[H]=t; /* undo move,G can be dummy */ o[]={-16,-15,-17,0,1,16,0,1,16,15,17,0,14,18,31,33,0, /* step-vector lists */ if(Y&8){m=v;Y&=~8;goto A;} /* best=1st done,redo normal*/ 7,-1,11,6,8,3,6, /* 1st dir. in o[] per piece*/ if(v>m){m=v;X=x;Y=y|S&G;} /* update max, mark with S */ 6,3,5,7,4,5,3,6}, /* initial piece setup */ } /* if non castling */ b[129], /* board: half of 16x8+dummy*/ t+=p<5; /* fake capt. for nonsliding*/ T[1035], /* hash translation table */ if(p<3&6*k+(y&V)==S /* pawn on 3rd/6th, or */ ||(u&~24)==36&j==7&& /* virgin K moving sideways,*/ n[]=quot;.?+nkbrq?*?NKBRQquot;; /* piece symbols on printout*/ G&M&&b[G=(x|7)-(r>>1&7)]&32 /* 1st, virgin R in corner G*/ &&!(b[G^1]|b[G^2]) /* 2 empty sqrs. next to R */ D(k,q,l,e,J,Z,E,z,n) /* recursive minimax search, k=moving side, n=depth*/ ){F=y;t--;} /* unfake capt., enable e.p.*/ int k,q,l,e,J,Z,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ }W(!t); /* if not capt. continue ray*/ { /* e=score, z=prev.dest; J,Z=hashkeys; return score*/ }}}W((x=x+9&~M)-B); /* next sqr. of board, wrap */ int j,r,m,v,d,h,i=9,F,G; C:if(m>I/4|m<-I/4)d=99; /* mate is indep. of depth */ char t,p,u,x,y,X,Y,H,B; m=m+I?m:-D(24-k,-I,I,0,J,Z,S,S,1)/2; /* best loses K: (stale)mate*/ struct _*a=A; if(!a->K|(a->X&M)!=M|a->D<=d) /* if new/better type/depth:*/ /* lookup pos. in hash table*/ {a->K=Z;a->V=m;a->D=d;A->K=0; /* store in hash,dummy stays*/ j=(k*E^J)&U-9; /* try 8 consec. locations */ a->X=X|8*(m>q)|S*(m<l);a->Y=Y; /* empty, type (limit/exact)*/ W((h=A[++j].K)&&h-Z&&--i); /* first empty or match */ } /* encoded in X S,8 bits */ a+=i?j:0; /* dummy A[0] if miss & full*/ /*if(z==8)printf(quot;%2d ply, %9d searched, %6d by (%2x,%2x) if(a->K) /* hit: pos. is in hash tab */ nquot;,d-1,N,m,X,Y&0x77);*/ {d=a->D;v=a->V;X=a->X; /* examine stored data */ } if(d>=n) /* if depth sufficient: */ if(z&8){K=X;L=Y&~M;} {if(v>=l|X&S&&v<=q|X&8)return v; /* use if window compatible */ return m; d=n-1; /* or use as iter. start */ } }X&=~M;Y=a->Y; /* with best-move hint */ Y=d?Y:0; /* don't try best at d=0 */ main() }else d=X=Y=0; /* start iter., no best yet */ { N++; /* node count (for timing) */ int j,k=8,*p,c[9]; W(d++<n|z==8&N<1e7&d<98) /* iterative deepening loop */ {x=B=X; /* start scan at prev. best */ F(i,0,8) Y|=8&Y>>4; /* request try noncastl. 1st*/ {b[i]=(b[i+V]=o[i+24]+40)+8;b[i+16]=18;b[i+96]=9; /* initial board setup*/ m=d>1?-I:e; /* unconsidered:static eval */ F(j,0,8)b[16*j+i+8]=(i-4)*(i-4)+(j-3.5)*(j-3.5); /* center-pts table */ do{u=b[x]; /* scan board looking for */ } /*(in unused half b[])*/ if(u&k) /* own piece (inefficient!)*/ F(i,M,1035)T[i]=random()>>9; {r=p=u&7; /* p = piece type (set r>0) */ j=o[p+16]; /* first step vector f.piece*/ W(1) /* play loop */ W(r=p>2&r<0?-r:-o[++j]) /* loop over directions o[] */ {F(i,0,121)printf(quot; %cquot;,i&8&&(i+=7)?10:n[b[i]&15]); /* print board */ {A: /* resume normal after best */ p=c;W((*p++=getchar())>10); /* read input line */ y=x;F=G=S; /* (x,y)=move, (F,G)=castl.R*/ N=0; do{H=y+=r; /* y traverses ray */ if(*c-10){K=c[0]-16*c[1]+C;L=c[2]-16*c[3]+C;}else /* parse entered move */ if(Y&8)H=y=Y&~M; /* sneak in prev. best move */ D(k,-I,I,Q,1,1,O,8,0); /* or think up one */ if(y&M)break; /* board edge hit */ F(i,0,U)A[i].K=0; /* clear hash table */ if(p<3&y==E)H=y^16; /* shift capt.sqr. H if e.p.*/ if(D(k,-I,I,Q,1,1,O,9,2)==I)k^=24; /* check legality & do*/ t=b[H];if(t&k|p<3&!(r&7)!=!t)break; /* capt. own, bad pawn mode */ } i=99*w[t&7]; /* value of capt. piece t */ }
  17. Old Habits Die Hard
  18. Software... Visualization?
  19. preemptive disclaimer no silver bullet visualization is only a means, not the end
  20. We are Visual Beings 70% of all brain inputs come through the eyes
  21. We see with our brain
  22. We see with our brain ‣ We have 3 types of memory that process visual information
  23. We see with our brain ‣ We have 3 types of memory that process visual information ‣ Iconic, the visual sensory register
  24. We see with our brain ‣ We have 3 types of memory that process visual information ‣ Iconic, the visual sensory register ‣ Short-term, the brain’s working memory
  25. We see with our brain ‣ We have 3 types of memory that process visual information ‣ Iconic, the visual sensory register ‣ Short-term, the brain’s working memory ‣ Long-term
  26. We see with our brain ‣ We have 3 types of memory that process visual information ‣ Iconic, the visual sensory register ‣ Short-term, the brain’s working memory ‣ Long-term
  27. Iconic and Short-term Memory
  28. Iconic and Short-term Memory ‣ Iconic memory is a “buffer” that retains information for less than 1 second before passing it to short-term memory
  29. Iconic and Short-term Memory ‣ Iconic memory is a “buffer” that retains information for less than 1 second before passing it to short-term memory ‣ Perception is very fast, automatic & subconscious, therefore called pre-attentive
  30. Iconic and Short-term Memory ‣ Iconic memory is a “buffer” that retains information for less than 1 second before passing it to short-term memory ‣ Perception is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term memory processes information in the form of “chunks”
  31. Iconic and Short-term Memory ‣ Iconic memory is a “buffer” that retains information for less than 1 second before passing it to short-term memory ‣ Perception is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term memory processes information in the form of “chunks” ‣ Temporary, a couple of seconds
  32. Iconic and Short-term Memory ‣ Iconic memory is a “buffer” that retains information for less than 1 second before passing it to short-term memory ‣ Perception is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term memory processes information in the form of “chunks” ‣ Temporary, a couple of seconds ‣ Limited capacity: 3 - 9 chunks
  33. Exemplifying Pre-attentive Processing
  34. Exemplifying Pre-attentive Processing 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598
  35. Exemplifying Pre-attentive Processing 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598
  36. Preattentive Attributes Examples Orientation Line Length Line Width Size Shape Curvature Added Marks Enclosure
  37. Preattentive Attributes Examples Line Length Line Width Size Shape Curvature Added Marks Enclosure
  38. Preattentive Attributes Examples Line Width Size Shape Curvature Added Marks Enclosure
  39. Preattentive Attributes Examples Size Shape Curvature Added Marks Enclosure
  40. Preattentive Attributes Examples Shape Curvature Added Marks Enclosure
  41. Preattentive Attributes Examples Curvature Added Marks Enclosure
  42. Preattentive Attributes Examples Added Marks Enclosure
  43. Preattentive Attributes Examples Enclosure
  44. Preattentive Attributes Examples
  45. Software Visualization “The use of the crafts of typography, graphic design, animation, and cinematography with modern human- computer interaction and computer graphics technology to facilitate both the human understanding and effective use of computer software.” John Stasko, 1998
  46. ati on s ua liz re vi ftwa ot so n
  47. Visualization is about stories
  48. 1854, London, cholera epidemic
  49. A Picture is Worth a Thousand Words
  50. lly :) li tera ok it L to U M
  51. Software is intangible, having no physical shape or size. Thomas Ball, 1996
  52. simple is beautiful
  53. The Polymetric View Principle number of attributes number of lines of code number of methods
  54. System Complexity View
  55. a simple and powerful concept
  56. Software Visualization is not Visual Programming
  57. http://atelier.inf.unisi.ch/~malnatij/xray.php Released: Nov 2007
  58. http://atelier.inf.unisi.ch/~malnatij/xray.php 3800 + Released: downloads Nov 2007 free
  59. Where’s the Beauty?
  60. Part 2 Software is beautiful
  61. The best defense is attack
  62. Richard Wettel, PhD student ‣ R. Wettel, M. Lanza; Program Comprehension through Software Habitability. In Proceedings of ICPC 2007 (15th International Conference on Program Comprehension), pp. 231 - 240, IEEE CS Press, 2007 ‣ R. Wettel, M. Lanza; Visualizing Software Systems as Cities. In Proceedings of VISSOFT 2007 (4th International Workshop on Visualizing Software for Understanding and Analysis), pp. 92 - 99, IEEE CS Press, 2007 ‣ R. Wettel, M. Lanza; Visually Localizing Design Problems with Disharmony Maps. In Proceedings of Softvis 2008 (4th International ACM Symposium on Software Visualization), pp. 155 - 164, ACM Press, 2008. ‣ R. Wettel, M. Lanza; Visual Exploration of Large-scale System Evolution. In Proceedings of WCRE 2008 (15th Working Conference on Reverse Engineering), to be published, IEEE CS Press, 2008
  63. How can we solve Ball’s dilemma? Metaphors..
  64. Habitability is the characteristic of source code that enables programmers, coders, bug-fixers, and people coming to the code later in its life to understand its construction and intentions and to change it comfortably and confidently. Richard Gabriel On “Habitability and Piecemeal Growth”; in “Patterns of Software”
  65. Visualizing Software Systems as Code Cities
  66. The City Metaphor
  67. The City Metaphor domain mapping classes buildings packages districts system city
  68. The City Metaphor domain mapping classes buildings packages districts system city
  69. The City Metaphor domain mapping classes buildings packages districts system city
  70. The City Metaphor domain mapping classes buildings packages districts system city class metric building property number of methods (NOM) height number of attributes (NOA) width, length package metric district property nesting level color
  71. Welcome to ArgoUML City ArgoUML City pop. 2,522 classes, 143 packages
  72. Software Topology Azureus City pop. 4’500+ classes
  73. Software Topology Azureus City pop. 4’500+ classes
  74. Software Topology Azureus City pop. 4’500+ classes
  75. Crossing System Boundaries Azureus ArgoUML
  76. Scalability? Cincom Smalltalk City pop. 8,000+ classes
  77. Mapping Metrics identity linear boxplot-based threshold-based
  78. Mapping Metrics identity linear boxplot-based threshold-based
  79. Mapping Metrics identity linear boxplot-based threshold-based
  80. Mapping Metrics identity linear boxplot-based threshold-based
  81. Mapping Metrics identity linear boxplot-based threshold-based
  82. OK... so what?
  83. applications
  84. applications
  85. applications
  86. applications
  87. Large-scale Program Comprehension
  88. City Lights..
  89. City Lights.. skyscrapers (NOM, NOA)
  90. City Lights.. skyscrapers (NOM, NOA) parking lots (NOM, NOA)
  91. City Lights.. skyscrapers (NOM, NOA) office buildings parking lots (NOM, NOA) (NOM, NOA)
  92. Sightseeing ArgoUML
  93. Sightseeing ArgoUML org.argouml.language. java.generator JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 0 methods 91 methods
  94. Sightseeing ArgoUML org.argouml.language. java.generator JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 0 methods 91 methods org.argouml.uml.reveng.classfile STDCTokenTypes CPPParser 152 attributes 85 attributes 0 methods 204 methods
  95. Sightseeing ArgoUML org.argouml.language. java.generator org.argouml.uml.reveng.java JavaTokenTypes JavaRecognizer JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 173 attributes 79 attributes 0 methods 91 methods 0 methods 176 methods org.argouml.uml.reveng.classfile STDCTokenTypes CPPParser 152 attributes 85 attributes 0 methods 204 methods
  96. Sightseeing ArgoUML org.argouml.language. java.generator org.argouml.uml.reveng.java JavaTokenTypes JavaRecognizer JavaTokenTypes JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 145 attributes 173 attributes 79 attributes 0 methods 91 methods 0 methods 0 methods 176 methods org.argouml.uml.reveng.classfile STDCTokenTypes CPPParser 152 attributes 85 attributes 0 methods 204 methods
  97. Sightseeing ArgoUML org.argouml.language. java.generator org.argouml.uml.reveng.java JavaTokenTypes JavaRecognizer JavaTokenTypes JavaRecognizer JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 145 attributes 22 attributes 173 attributes 79 attributes 0 methods 91 methods 0 methods 88 methods 0 methods 176 methods org.argouml.uml.reveng.classfile STDCTokenTypes CPPParser 152 attributes 85 attributes 0 methods 204 methods
  98. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  99. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  100. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  101. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  102. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  103. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  104. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  105. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  106. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  107. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  108. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  109. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105
  110. System Language NOP NOC kLOC Azureus Java 457 4734 274 ArgoUML Java 144 2542 137 JHotDraw Java 72 998 30 iText Java 149 1250 80 Jmol Java 105 1032 85 JDK 1.5 core Java 137 4715 160 Moose Smalltalk 278 961 32 Jun Smalltalk 288 2236 351 CodeCity Smalltalk 129 291 18 ScumVM C++ 18 1331 105 1,250,000 LOC
  111. Evolution Analysis
  112. ArgoUML’s filmstrip Ver. 0.10.1 Ver. 0.12 Ver. 0.14 ModelFacade 9/10/2002 18/08/2003 5/12/2003 ModelFacade FacadeMDRImpl NSUMLModelFacade Facade Ver. 0.16 NSUMLModelFacade 19/07/2004 Facade Ver. 0.18.1 Ver. 0.20 FacadeMDRImpl 30/04/2005 9/02/2006 Facade Ver. 0.22 Ver. 0.23.4 Ver. 0.24 8/08/2006 10/12/2006 12/02/2007
  113. ArgoUML Age Map org.argouml.language.cpp STDCTokenTypes FacadeMDRImpl NOA 152, NOM 0, AGE 4 Facade NOA 3, NOM 351, AGE 4 org.argouml.language.php NOA 1, NOM 339, AGE 5 org.argouml.language.csharp CPPParser NOA 85, NOM 204, AGE 4 org.argouml.language.java org.argouml.model JavaRecognizer NOA 24, NOM 91, AGE 9 JavaTokenTypes NOA 146, NOM 0, AGE 9 org.argouml.uml.reveng.java JavaTokenTypes NOA 175, NOM 0, AGE 9 JavaRecognizer NOA 79, NOM 176, AGE 9
  114. JHotDraw Age map
  115. Age map interpretation age: 1 2 3 4 5 6 7 8
  116. Age map interpretation age: 1 2 3 4 5 6 7 8 stable very old
  117. Age map interpretation age: 1 2 3 4 5 6 7 8 stable rarely updated very old old
  118. Age map interpretation age: 1 2 3 4 5 6 7 8 stable highly unstable rarely updated very old old young
  119. Age map interpretation updated often, age: 1 2 3 4 5 6 7 8 rather unstable stable highly unstable rarely updated very old old young very old
  120. JHotDraw’s Travel through Time
  121. JHotDraw’s Travel through Time
  122. Jmol’s Travel through Time
  123. Jmol’s Travel through Time
  124. Design Disharmony maps
  125. Shameless Plug M. Lanza, R. Marinescu “Object-Oriented Metrics in Practice” Springer, 2006 ISBN 3-540-24429-8
  126. Identity Disharmony How do I define myself?
  127. Identity Disharmony God Class Data Class Brain Class How do I Feature Envy define myself? Brain Method
  128. Collaboration Disharmony How do I interact with others?
  129. Collaboration Disharmony Intensive Coupling Dispersive Coupling How do I Shotgun Surgery interact with others?
  130. Classification Disharmony How do I define myself with respect to my ancestors and descendants?
  131. Classification Disharmony Futile Hierarchy Tradition Breaker How do I define Refused Parent Bequest myself with respect to my ancestors and descendants?
  132. Shotgun Surgery has uses is has (partial) Feature Data Envy uses Class is partially God has Intensive Class Coupling Brain has has Method Extensive Brain has Significant Coupling Class Duplication has is is has Refused is Tradition Parent Breaker Bequest has (subclass) Futile Hierarchy Identity Collaboration Classification Disharmonies Disharmonies Disharmonies
  133. God Class “In a good object-oriented design the intelligence of a system is uniformly distributed among the top-level classes.” Arthur Riel, 1996
  134. Characteristics of a God Class
  135. Characteristics of a God Class Heavily accesses data of other “lightweight” classes,either directly or using accessor methods.
  136. Characteristics of a God Class Heavily accesses data of other “lightweight” classes,either directly or using Is large accessor methods.
  137. 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
  138. 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
  139. The God Class detection strategy
  140. How should we display design problems? World distribution of Myxobolus cerebralis
  141. JDK 1.5 God Classes
  142. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes 109 Data classes
  143. JDK’s Idendity Disharmony map Component NOA 88, NOM 280 12 Brain classes 16 65 God classes 109 Data classes
  144. JDK’s Idendity Disharmony map Security NOA 3, NOM 30 12 Brain classes 16 65 God classes 109 Data classes
  145. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes 109 Data classes java.awt.event
  146. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes KeyEvent NOA 205, NOM 18 109 Data classes
  147. JDK’s Idendity Disharmony map InputEvent 12 Brain classes NOA 21, NOM 14 16 65 God classes 109 Data classes
  148. JDK’s Idendity Disharmony map java.awt.geom 12 Brain classes 16 65 God classes 109 Data classes
  149. ArgoUML’s Identity disharmony map 8 Brain classes 9 24 God classes 17 Data classes
  150. ArgoUML’s Identity 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
  151. Jmol’s Feature Envy Feature envy
  152. Jmol’s Feature Envy Feature envy 1,500 methods (25 %)
  153. ArgoUML.Model’s Shotgun Surgery Map Facade AggregationKind VisibilityKind NOM 140/337 NOM 3/3 NOM 4/4 PseudostateKind NOM 6/6 Model NOM 28/44 Shotgun surgery
  154. Tool support
  155. http://www.inf.unisi.ch/phd/wettel/codecity.html Released: Mar 2008
  156. http://www.inf.unisi.ch/phd/wettel/codecity.html 1200 + Released: downloads Mar 2008 free
  157. Epilogue Huh?
  158. Reflections
  159. Reflections Visualizations are useless
  160. Reflections Visualizations are useless ..as pictures
  161. Reflections Visualizations are useless ..as pictures ..if not accessible
  162. Reflections Visualizations are useless ..as pictures ..if not accessible It’ll take time for acceptance
  163. Reflections Visualizations are useless ..as pictures ..if not accessible It’ll take time for acceptance ..time is on my side
  164. The End? - No, just the beginning..
  165. Beautiful Software Michele Lanza

×