SlideShare a Scribd company logo
1 of 177
Of Code and Change:
Beautiful Software
Michele Lanza

REVEAL @ Faculty of Informatics
University of Lugano, Switzerland
Of Code and Change:
Beautiful Software
Michele Lanza

REVEAL @ Faculty of Informatics
University of Lugano, Switzerland
Beautiful Software
Michele Lanza
Prologue
Who the heck is this guy?
Michele Lanza
Michele Lanza
Michele Lanza
Michele Lanza
Academic Research
Industrial Reality
Military Research
Part 1
Software Visualization 101
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.
Source Code = Text
Programming = Writing
/***************************************************************************/           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   */   }
Old Habits Die Hard
Software... Visualization?
preemptive
 disclaimer

no silver bullet

visualization is
only a means,
  not the end
We are Visual Beings

70% of all brain inputs come
            through the eyes
We see with our brain
We see with our brain


 ‣ We have 3 types of memory that
   process visual information
We see with our brain


 ‣ We have 3 types of memory that
   process visual information
   ‣ Iconic, the visual sensory register
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
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
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
Iconic and Short-term Memory
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
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
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”
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
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
Exemplifying Pre-attentive Processing
Exemplifying Pre-attentive Processing


     8789364082376403128764532984732984732094873290845
     389274-0329874-32874-23198475098340983409832409832
     049823-0984903281453209481-0839393947896387436598
Exemplifying Pre-attentive Processing


     8789364082376403128764532984732984732094873290845
     389274-0329874-32874-23198475098340983409832409832
     049823-0984903281453209481-0839393947896387436598


     8789364082376403128764532984732984732094873290845
     389274-0329874-32874-23198475098340983409832409832
     049823-0984903281453209481-0839393947896387436598
Preattentive Attributes Examples




 Orientation   Line Length   Line Width      Size




   Shape       Curvature     Added Marks   Enclosure
Preattentive Attributes Examples




             Line Length   Line Width      Size




   Shape      Curvature    Added Marks   Enclosure
Preattentive Attributes Examples




                          Line Width      Size




   Shape      Curvature   Added Marks   Enclosure
Preattentive Attributes Examples




                                          Size




   Shape      Curvature   Added Marks   Enclosure
Preattentive Attributes Examples




   Shape      Curvature   Added Marks   Enclosure
Preattentive Attributes Examples




              Curvature   Added Marks   Enclosure
Preattentive Attributes Examples




                        Added Marks   Enclosure
Preattentive Attributes Examples




                                   Enclosure
Preattentive Attributes Examples
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
ati on
                s ua liz
           re vi
       ftwa
 ot so
n
Visualization is about stories
1854,
London,
cholera
epidemic
A Picture is Worth a Thousand Words
lly :)
               li tera
       ok it
   L to
U M
Software is intangible,
having no physical shape or size.




                                Thomas Ball, 1996
simple is beautiful
The Polymetric View Principle



      number of attributes



            number of
          lines of code      number of methods
System Complexity View
a simple and powerful concept
Software Visualization
is not Visual Programming
http://atelier.inf.unisi.ch/~malnatij/xray.php




Released:
Nov 2007
http://atelier.inf.unisi.ch/~malnatij/xray.php




                                           3800 +
Released:                                  downloads

Nov 2007                                     free
Where’s the Beauty?
Part 2
Software is beautiful
The best defense is attack
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
How can we solve Ball’s
            dilemma?

                 Metaphors..
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”
Visualizing Software Systems
        as Code Cities
The City Metaphor
The City Metaphor

domain mapping

classes          buildings


packages         districts


system           city
The City Metaphor

domain mapping

classes          buildings


packages         districts


system           city
The City Metaphor

domain mapping

classes          buildings


packages         districts


system           city
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
Welcome to ArgoUML City




                                 ArgoUML City
                          pop. 2,522 classes, 143 packages
Software Topology




                     Azureus City
                    pop. 4’500+ classes
Software Topology




                     Azureus City
                    pop. 4’500+ classes
Software Topology




                     Azureus City
                    pop. 4’500+ classes
Crossing System Boundaries


Azureus                      ArgoUML
Scalability?




               Cincom Smalltalk City
                  pop. 8,000+ classes
Mapping Metrics




                         identity
                           linear
                   boxplot-based
                  threshold-based
Mapping Metrics




                         identity
                           linear
                   boxplot-based
                  threshold-based
Mapping Metrics




                         identity
                           linear
                   boxplot-based
                  threshold-based
Mapping Metrics




                         identity
                           linear
                   boxplot-based
                  threshold-based
Mapping Metrics




                         identity
                           linear
                   boxplot-based
                  threshold-based
OK... so what?
applications
applications
applications
applications
Large-scale Program Comprehension
City Lights..
City Lights..

      skyscrapers
      (NOM, NOA)
City Lights..

      skyscrapers
      (NOM, NOA)




parking lots
(NOM, NOA)
City Lights..

      skyscrapers
      (NOM, NOA)




                     office buildings
parking lots
                    (NOM, NOA)
(NOM, NOA)
Sightseeing ArgoUML
Sightseeing ArgoUML

   org.argouml.language. java.generator

 JavaTokenTypes      JavaRecognizer
 146 attributes      24 attributes
 0 methods           91 methods
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Evolution Analysis
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
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
JHotDraw Age map
Age map interpretation


 age: 1 2 3 4 5 6 7 8
Age map interpretation


 age: 1 2 3 4 5 6 7 8

  stable




  very old
Age map interpretation


 age: 1 2 3 4 5 6 7 8

  stable




             rarely updated



  very old        old
Age map interpretation


 age: 1 2 3 4 5 6 7 8

  stable
                              highly unstable


             rarely updated



  very old        old            young
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
JHotDraw’s Travel through Time
JHotDraw’s Travel through Time
Jmol’s Travel through Time
Jmol’s Travel through Time
Design Disharmony maps
Shameless Plug

             M. Lanza, R. Marinescu
“Object-Oriented Metrics in Practice”

                       Springer, 2006
                 ISBN 3-540-24429-8
Identity Disharmony


               How do I
                define
                myself?
Identity Disharmony          God Class
                             Data Class
                            Brain Class
               How do I    Feature Envy
                define
                myself?
                          Brain Method
Collaboration Disharmony


                 How do I
               interact with
                  others?
Collaboration Disharmony
                                Intensive Coupling
                               Dispersive Coupling
                 How do I          Shotgun Surgery
               interact with
                  others?
Classification Disharmony


                 How do I define
               myself with respect to
                my ancestors and
                  descendants?
Classification Disharmony
                                               Futile Hierarchy
                                              Tradition Breaker
                 How do I define         Refused Parent Bequest
               myself with respect to
                my ancestors and
                  descendants?
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
God Class

“In a good object-oriented design
     the intelligence of a system is
 uniformly distributed among the
                  top-level classes.”

                 Arthur Riel, 1996
Characteristics of a God Class
Characteristics of a God Class


       Heavily accesses data
       of other “lightweight”
       classes,either
       directly or using
       accessor
       methods.
Characteristics of a God Class


       Heavily accesses data
       of other “lightweight”
       classes,either
       directly or using         Is large
       accessor
       methods.
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
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
The God Class detection strategy
How should we display design problems?




             World distribution of Myxobolus cerebralis
JDK 1.5 God Classes
JDK’s Idendity Disharmony map




     12 Brain classes
16
     65 God classes
     109   Data classes
JDK’s Idendity Disharmony map
Component
NOA 88, NOM 280




      12 Brain classes
 16
      65 God classes
      109   Data classes
JDK’s Idendity Disharmony map
                                Security
                                NOA 3, NOM 30




     12 Brain classes
16
     65 God classes
     109   Data classes
JDK’s Idendity Disharmony map




     12 Brain classes
16
     65 God classes
     109   Data classes
                          java.awt.event
JDK’s Idendity Disharmony map




     12 Brain classes
16
     65 God classes       KeyEvent
                          NOA 205, NOM 18
     109   Data classes
JDK’s Idendity Disharmony map




                                InputEvent
     12 Brain classes           NOA 21, NOM 14
16
     65 God classes
     109   Data classes
JDK’s Idendity Disharmony map




java.awt.geom




      12 Brain classes
 16
      65 God classes
      109   Data classes
ArgoUML’s Identity disharmony map

     8 Brain classes
 9
     24 God classes
     17 Data classes
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
Jmol’s Feature Envy

   Feature envy
Jmol’s Feature Envy

   Feature envy




 1,500 methods (25 %)
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
Tool support
http://www.inf.unisi.ch/phd/wettel/codecity.html




Released:
Mar 2008
http://www.inf.unisi.ch/phd/wettel/codecity.html




                                        1200 +
Released:                               downloads

Mar 2008                                  free
Epilogue
Huh?
Reflections
Reflections

Visualizations are useless
Reflections

Visualizations are useless
             ..as pictures
Reflections

Visualizations are useless
               ..as pictures
        ..if not accessible
Reflections

   Visualizations are useless
                  ..as pictures
           ..if not accessible

It’ll take time for acceptance
Reflections

   Visualizations are useless
                  ..as pictures
           ..if not accessible

It’ll take time for acceptance
           ..time is on my side
The End? - No, just the beginning..
Beautiful Software
Michele Lanza

More Related Content

What's hot

Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scriptingVIKAS TIWARI
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemMohammad Imam Hossain
 
C++ Programming.pdf
C++ Programming.pdfC++ Programming.pdf
C++ Programming.pdfMrRSmey
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handlingRohitK71
 
#2 formal methods – principles of logic
#2 formal methods – principles of logic#2 formal methods – principles of logic
#2 formal methods – principles of logicSharif Omar Salem
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
State space search
State space searchState space search
State space searchchauhankapil
 
Array sorting
Array sortingArray sorting
Array sortingALI RAZA
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3sumitbardhan
 
Insertion sort
Insertion sortInsertion sort
Insertion sortRajendran
 
TOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite AutomataTOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite AutomataMohammad Imam Hossain
 
C programming - String
C programming - StringC programming - String
C programming - StringAchyut Devkota
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : BasicsMitul Desai
 

What's hot (20)

Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
C++ Programming.pdf
C++ Programming.pdfC++ Programming.pdf
C++ Programming.pdf
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handling
 
#2 formal methods – principles of logic
#2 formal methods – principles of logic#2 formal methods – principles of logic
#2 formal methods – principles of logic
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
State space search
State space searchState space search
State space search
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Array sorting
Array sortingArray sorting
Array sorting
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
TOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite AutomataTOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite Automata
 
Python made easy
Python made easy Python made easy
Python made easy
 
TOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFATOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFA
 
C programming - String
C programming - StringC programming - String
C programming - String
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : Basics
 
First order logic
First order logicFirst order logic
First order logic
 

Viewers also liked

A Holistic Approach to Evolving Software Systems
A Holistic Approach to Evolving Software SystemsA Holistic Approach to Evolving Software Systems
A Holistic Approach to Evolving Software SystemsMichele Lanza
 
Beauty is in the Eye of the Beholder
Beauty is in the Eye of the BeholderBeauty is in the Eye of the Beholder
Beauty is in the Eye of the BeholderMichele Lanza
 
The Visual Terminator
The Visual TerminatorThe Visual Terminator
The Visual TerminatorMichele Lanza
 
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...Michele Lanza
 
Software Visualization - Promises & Perils
Software Visualization - Promises & PerilsSoftware Visualization - Promises & Perils
Software Visualization - Promises & PerilsMichele Lanza
 
EvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
EvoSpaces - Multi-dimensional Navigation Spaces for Software EvolutionEvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
EvoSpaces - Multi-dimensional Navigation Spaces for Software EvolutionMichele Lanza
 
Visualizing Gnome with the Small Project Observatory
Visualizing Gnome with the Small Project ObservatoryVisualizing Gnome with the Small Project Observatory
Visualizing Gnome with the Small Project ObservatoryMichele Lanza
 
Software Visualization 101+
Software Visualization 101+Software Visualization 101+
Software Visualization 101+Michele Lanza
 
Smalltalk In a Nutshell
Smalltalk In a NutshellSmalltalk In a Nutshell
Smalltalk In a NutshellMichele Lanza
 
Object-Oriented Metrics in Practice
Object-Oriented Metrics in PracticeObject-Oriented Metrics in Practice
Object-Oriented Metrics in PracticeMichele Lanza
 
하둡 (Hadoop) 및 관련기술 훑어보기
하둡 (Hadoop) 및 관련기술 훑어보기하둡 (Hadoop) 및 관련기술 훑어보기
하둡 (Hadoop) 및 관련기술 훑어보기beom kyun choi
 
[H3 2012] 오픈소스로 개발 실력 쌓기
[H3 2012] 오픈소스로 개발 실력 쌓기[H3 2012] 오픈소스로 개발 실력 쌓기
[H3 2012] 오픈소스로 개발 실력 쌓기KTH, 케이티하이텔
 

Viewers also liked (14)

A Holistic Approach to Evolving Software Systems
A Holistic Approach to Evolving Software SystemsA Holistic Approach to Evolving Software Systems
A Holistic Approach to Evolving Software Systems
 
Beauty is in the Eye of the Beholder
Beauty is in the Eye of the BeholderBeauty is in the Eye of the Beholder
Beauty is in the Eye of the Beholder
 
The Visual Terminator
The Visual TerminatorThe Visual Terminator
The Visual Terminator
 
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
 
Seeing Software
Seeing SoftwareSeeing Software
Seeing Software
 
Software Visualization - Promises & Perils
Software Visualization - Promises & PerilsSoftware Visualization - Promises & Perils
Software Visualization - Promises & Perils
 
Software Evolution
Software EvolutionSoftware Evolution
Software Evolution
 
EvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
EvoSpaces - Multi-dimensional Navigation Spaces for Software EvolutionEvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
EvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
 
Visualizing Gnome with the Small Project Observatory
Visualizing Gnome with the Small Project ObservatoryVisualizing Gnome with the Small Project Observatory
Visualizing Gnome with the Small Project Observatory
 
Software Visualization 101+
Software Visualization 101+Software Visualization 101+
Software Visualization 101+
 
Smalltalk In a Nutshell
Smalltalk In a NutshellSmalltalk In a Nutshell
Smalltalk In a Nutshell
 
Object-Oriented Metrics in Practice
Object-Oriented Metrics in PracticeObject-Oriented Metrics in Practice
Object-Oriented Metrics in Practice
 
하둡 (Hadoop) 및 관련기술 훑어보기
하둡 (Hadoop) 및 관련기술 훑어보기하둡 (Hadoop) 및 관련기술 훑어보기
하둡 (Hadoop) 및 관련기술 훑어보기
 
[H3 2012] 오픈소스로 개발 실력 쌓기
[H3 2012] 오픈소스로 개발 실력 쌓기[H3 2012] 오픈소스로 개발 실력 쌓기
[H3 2012] 오픈소스로 개발 실력 쌓기
 

Similar to Of Code and Change: Beautiful Software

write the TODO part of the program.docx
write the TODO part of the program.docxwrite the TODO part of the program.docx
write the TODO part of the program.docxannetnash8266
 
2Part I1. Answer questions for the following graph, if .docx
2Part I1. Answer questions for the following graph, if .docx2Part I1. Answer questions for the following graph, if .docx
2Part I1. Answer questions for the following graph, if .docxgilbertkpeters11344
 
java-introduction.pdf
java-introduction.pdfjava-introduction.pdf
java-introduction.pdfDngTin307322
 
Junaid program assignment
Junaid program assignmentJunaid program assignment
Junaid program assignmentJunaid Ahmed
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docxAdamq0DJonese
 
Class Customization and Better Code
Class Customization and Better CodeClass Customization and Better Code
Class Customization and Better CodeStronnics
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdfanujmkt
 
Introduction You implemented a Deck class in Activity 2. This cla.pdf
Introduction You implemented a Deck class in Activity 2. This cla.pdfIntroduction You implemented a Deck class in Activity 2. This cla.pdf
Introduction You implemented a Deck class in Activity 2. This cla.pdffeelinggifts
 
#include stdafx.h using namespace std; #include stdlib.h.docx
#include stdafx.h using namespace std; #include stdlib.h.docx#include stdafx.h using namespace std; #include stdlib.h.docx
#include stdafx.h using namespace std; #include stdlib.h.docxajoy21
 
Assignement c++
Assignement c++Assignement c++
Assignement c++Syed Umair
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?jonbodner
 
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1rohit kumar
 
Bab 6
Bab 6Bab 6
Bab 6Zinoa
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Ray Buse
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisaujihisa
 

Similar to Of Code and Change: Beautiful Software (20)

write the TODO part of the program.docx
write the TODO part of the program.docxwrite the TODO part of the program.docx
write the TODO part of the program.docx
 
2Part I1. Answer questions for the following graph, if .docx
2Part I1. Answer questions for the following graph, if .docx2Part I1. Answer questions for the following graph, if .docx
2Part I1. Answer questions for the following graph, if .docx
 
Java
JavaJava
Java
 
java-introduction.pdf
java-introduction.pdfjava-introduction.pdf
java-introduction.pdf
 
Junaid program assignment
Junaid program assignmentJunaid program assignment
Junaid program assignment
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
 
Class Customization and Better Code
Class Customization and Better CodeClass Customization and Better Code
Class Customization and Better Code
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdf
 
Introduction You implemented a Deck class in Activity 2. This cla.pdf
Introduction You implemented a Deck class in Activity 2. This cla.pdfIntroduction You implemented a Deck class in Activity 2. This cla.pdf
Introduction You implemented a Deck class in Activity 2. This cla.pdf
 
Academy PRO: ES2015
Academy PRO: ES2015Academy PRO: ES2015
Academy PRO: ES2015
 
#include stdafx.h using namespace std; #include stdlib.h.docx
#include stdafx.h using namespace std; #include stdlib.h.docx#include stdafx.h using namespace std; #include stdlib.h.docx
#include stdafx.h using namespace std; #include stdlib.h.docx
 
Assignement c++
Assignement c++Assignement c++
Assignement c++
 
About Go
About GoAbout Go
About Go
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?
 
Part 7
Part 7Part 7
Part 7
 
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
 
Functional JS+ ES6.pptx
Functional JS+ ES6.pptxFunctional JS+ ES6.pptx
Functional JS+ ES6.pptx
 
Bab 6
Bab 6Bab 6
Bab 6
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisa
 

Recently uploaded

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Recently uploaded (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

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
  • 4. Prologue Who the heck is this guy?
  • 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.
  • 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 */ }
  • 19.
  • 20. preemptive disclaimer no silver bullet visualization is only a means, not the end
  • 21. We are Visual Beings 70% of all brain inputs come through the eyes
  • 22. We see with our brain
  • 23. We see with our brain ‣ We have 3 types of memory that process visual information
  • 24. We see with our brain ‣ We have 3 types of memory that process visual information ‣ Iconic, the visual sensory register
  • 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
  • 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. 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
  • 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
  • 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
  • 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”
  • 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
  • 33. 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
  • 35. Exemplifying Pre-attentive Processing 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598
  • 36. Exemplifying Pre-attentive Processing 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598 8789364082376403128764532984732984732094873290845 389274-0329874-32874-23198475098340983409832409832 049823-0984903281453209481-0839393947896387436598
  • 37. Preattentive Attributes Examples Orientation Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 38. Preattentive Attributes Examples Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 39. Preattentive Attributes Examples Line Width Size Shape Curvature Added Marks Enclosure
  • 40. Preattentive Attributes Examples Size Shape Curvature Added Marks Enclosure
  • 41. Preattentive Attributes Examples Shape Curvature Added Marks Enclosure
  • 42. Preattentive Attributes Examples Curvature Added Marks Enclosure
  • 43. Preattentive Attributes Examples Added Marks Enclosure
  • 46. 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
  • 47.
  • 48. ati on s ua liz re vi ftwa ot so n
  • 51. A Picture is Worth a Thousand Words
  • 52.
  • 53. lly :) li tera ok it L to U M
  • 54. Software is intangible, having no physical shape or size. Thomas Ball, 1996
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. The Polymetric View Principle number of attributes number of lines of code number of methods
  • 61.
  • 63. a simple and powerful concept
  • 64. Software Visualization is not Visual Programming
  • 65.
  • 67. http://atelier.inf.unisi.ch/~malnatij/xray.php 3800 + Released: downloads Nov 2007 free
  • 69. Part 2 Software is beautiful
  • 70. The best defense is attack
  • 71. 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
  • 72. How can we solve Ball’s dilemma? Metaphors..
  • 73. 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”
  • 76. The City Metaphor domain mapping classes buildings packages districts system city
  • 77. The City Metaphor domain mapping classes buildings packages districts system city
  • 78. The City Metaphor domain mapping classes buildings packages districts system city
  • 79. 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
  • 80. Welcome to ArgoUML City ArgoUML City pop. 2,522 classes, 143 packages
  • 81. Software Topology Azureus City pop. 4’500+ classes
  • 82. Software Topology Azureus City pop. 4’500+ classes
  • 83. Software Topology Azureus City pop. 4’500+ classes
  • 85. Scalability? Cincom Smalltalk City pop. 8,000+ classes
  • 86. Mapping Metrics identity linear boxplot-based threshold-based
  • 87. Mapping Metrics identity linear boxplot-based threshold-based
  • 88. Mapping Metrics identity linear boxplot-based threshold-based
  • 89. Mapping Metrics identity linear boxplot-based threshold-based
  • 90. Mapping Metrics identity linear boxplot-based threshold-based
  • 98. City Lights.. skyscrapers (NOM, NOA)
  • 99. City Lights.. skyscrapers (NOM, NOA) parking lots (NOM, NOA)
  • 100. City Lights.. skyscrapers (NOM, NOA) office buildings parking lots (NOM, NOA) (NOM, NOA)
  • 102. Sightseeing ArgoUML org.argouml.language. java.generator JavaTokenTypes JavaRecognizer 146 attributes 24 attributes 0 methods 91 methods
  • 103. 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
  • 104. 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
  • 105. 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
  • 106. 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
  • 107.
  • 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
  • 111. 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
  • 112. 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
  • 113. 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
  • 114. 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
  • 115. 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
  • 116. 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
  • 117. 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
  • 118. 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
  • 119. 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
  • 120. 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
  • 122. 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
  • 123. 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
  • 125. Age map interpretation age: 1 2 3 4 5 6 7 8
  • 126. Age map interpretation age: 1 2 3 4 5 6 7 8 stable very old
  • 127. Age map interpretation age: 1 2 3 4 5 6 7 8 stable rarely updated very old old
  • 128. Age map interpretation age: 1 2 3 4 5 6 7 8 stable highly unstable rarely updated very old old young
  • 129. 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
  • 135. Shameless Plug M. Lanza, R. Marinescu “Object-Oriented Metrics in Practice” Springer, 2006 ISBN 3-540-24429-8
  • 136. Identity Disharmony How do I define myself?
  • 137. Identity Disharmony God Class Data Class Brain Class How do I Feature Envy define myself? Brain Method
  • 138. Collaboration Disharmony How do I interact with others?
  • 139. Collaboration Disharmony Intensive Coupling Dispersive Coupling How do I Shotgun Surgery interact with others?
  • 140. Classification Disharmony How do I define myself with respect to my ancestors and descendants?
  • 141. Classification Disharmony Futile Hierarchy Tradition Breaker How do I define Refused Parent Bequest myself with respect to my ancestors and descendants?
  • 142. 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
  • 143. God Class “In a good object-oriented design the intelligence of a system is uniformly distributed among the top-level classes.” Arthur Riel, 1996
  • 144. Characteristics of a God Class
  • 145. Characteristics of a God Class Heavily accesses data of other “lightweight” classes,either directly or using accessor methods.
  • 146. Characteristics of a God Class Heavily accesses data of other “lightweight” classes,either directly or using Is large accessor methods.
  • 147. 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
  • 148. 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
  • 149. The God Class detection strategy
  • 150. How should we display design problems? World distribution of Myxobolus cerebralis
  • 151. JDK 1.5 God Classes
  • 152. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes 109 Data classes
  • 153. JDK’s Idendity Disharmony map Component NOA 88, NOM 280 12 Brain classes 16 65 God classes 109 Data classes
  • 154. JDK’s Idendity Disharmony map Security NOA 3, NOM 30 12 Brain classes 16 65 God classes 109 Data classes
  • 155. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes 109 Data classes java.awt.event
  • 156. JDK’s Idendity Disharmony map 12 Brain classes 16 65 God classes KeyEvent NOA 205, NOM 18 109 Data classes
  • 157. JDK’s Idendity Disharmony map InputEvent 12 Brain classes NOA 21, NOM 14 16 65 God classes 109 Data classes
  • 158. JDK’s Idendity Disharmony map java.awt.geom 12 Brain classes 16 65 God classes 109 Data classes
  • 159. ArgoUML’s Identity disharmony map 8 Brain classes 9 24 God classes 17 Data classes
  • 160. 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
  • 161. Jmol’s Feature Envy Feature envy
  • 162. Jmol’s Feature Envy Feature envy 1,500 methods (25 %)
  • 163. 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
  • 166. http://www.inf.unisi.ch/phd/wettel/codecity.html 1200 + Released: downloads Mar 2008 free
  • 171. Reflections Visualizations are useless ..as pictures ..if not accessible
  • 172. Reflections Visualizations are useless ..as pictures ..if not accessible It’ll take time for acceptance
  • 173. Reflections Visualizations are useless ..as pictures ..if not accessible It’ll take time for acceptance ..time is on my side
  • 174. The End? - No, just the beginning..
  • 175.
  • 176.