Software Visualization 101+
Michele Lanza

REVEAL @ Faculty of Informatics
University of Lugano, Switzerland
Part I
Prologue
Michele Lanza
Michele Lanza
Michele Lanza
Michele Lanza
Academic Research
Industrial Reality
Military Fantasies
immersive
 fine-grained
                                      software
software evolution
                                   visualization
synchronous
                           next-gen visual
 development
                           programming


           software ecosystems

          bug analysis/prediction

             holistic evolution
Immersive Software Visualization

 ‣   R. Wettel, M. Lanza; Program Comprehension through Software Habitability. In
     ICPC 2007 (15th IEEE International Conference on Program Comprehension),
     pp. 231 - 240, IEEE CS Press, 2007
 ‣   R. Wettel, M. Lanza; Visualizing Software Systems as Cities. In VISSOFT 2007
     (4th IEEE 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 Softvis 2008 (4th ACM International Symposium on Software
     Visualization), pp. 155 - 164, ACM Press, 2008
 ‣   R. Wettel, M. Lanza; Visual Exploration of Large-scale System Evolution. In
     WCRE 2008 (15th IEEE Working Conference on Reverse Engineering), pp. 219
     - 228, IEEE CS Press, 2008
                                                                                      Richard Wettel
 ‣   R. Wettel, M. Lanza; CodeCity: 3D Visualization of Evolving Large-Scale
     Software. In ICSE 2008 (30th ACM/IEEE International Conference on Software
     Engineering), pp. 921 - 922, ACM Press, 2008.




                                                                                      CodeCity
Goals
Goals
Goals
Goals
Part II
Software
[Software is] anything
but hardware, [...] the "soft"
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[]=".?+nkbrq?*?NKBRQ";                         /* 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("%2d ply, %9d searched, %6d by (%2x,%2x)
  if(a->K)                                       /* hit: pos. is in hash tab */   n",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(" %c",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
Enjoy the Ride
Part III
Software Visualization
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
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.”
Software Visualization 101+
z at ion
                  isu ali
             ar ev
       so ftw
n ot
A picture is worth a thousand words
ng
                  ro thousand words
                w
A picture is worth a
Visualization is about stories
Software Visualization 101+
Software Visualization 101+
the
                          ith ly
                      g w eral
                   hin lit
             th et
       to ok       ds too
    L
UM and w        or
 t ho us
Part IV
Seeing
Seeing is Understanding
We are Visual Beings


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

 ‣ 3 types of memory to process
   visual information
   ‣ Iconic, the visual sensory register
   ‣ Short-term, the 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 of a limited set of attributes 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 of a limited set of attributes is very fast, automatic &
    subconscious, therefore called pre-attentive
‣ Short-term Memory processes information as “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 of a limited set of attributes is very fast, automatic &
    subconscious, therefore called pre-attentive
‣ Short-term Memory processes information as “chunks”
  ‣ Storage is temporary and of limited capacity (3-9 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 of a limited set of attributes is very fast, automatic &
    subconscious, therefore called pre-attentive
‣ Short-term Memory processes information as “chunks”
  ‣ Storage is temporary and of limited capacity (3-9 chunks)
    ‣   This explains why charts are more expressive than tables
Pre-attentive Processing Attributes
Pre-attentive Attributes of Form




 Orientation   Line Length    Line Width     Size




   Shape       Curvature     Added Marks   Enclosure
Pre-attentive Attributes of Form




              Line Length    Line Width     Size




   Shape      Curvature     Added Marks   Enclosure
Pre-attentive Attributes of Form




                           Line Width     Size




   Shape      Curvature   Added Marks   Enclosure
Pre-attentive Attributes of Form




                                          Size




   Shape      Curvature   Added Marks   Enclosure
Pre-attentive Attributes of Form




   Shape      Curvature   Added Marks   Enclosure
Pre-attentive Attributes of Form




              Curvature   Added Marks   Enclosure
Pre-attentive Attributes of Form




                          Added Marks   Enclosure
Pre-attentive Attributes of Form




                                   Enclosure
Pre-attentive Attributes of Form
Software Visualization 101+
Software Visualization 101+
Software Visualization 101+
Software Visualization 101+
The Polymetric View Principle



         number of attributes




              number of
                                number of methods
            lines of code
Software Visualization 101+
Software Visualization 101+
Software Visualization 101+
The X-Ray Eclipse Plugin   xray.inf.usi.ch




                                     6800+
                                   downloads
Released
Nov 2007                              free
Part V
Software Visualization++
The Class Blueprint
The Class Blueprint


      Initialize   Interface         Internal          Accessor   Attribute




                         invocation and access direction
Detailing the Class Blueprint

                                             internal access
                                                                              Access
                           external
                                                Attribute
                            access                                           Invocation



                                                                  Regular                 Constant
                                              invocations
                                                                Overriding                Delegating

                                     lines      Method
                                                                Extending                 Setter

 Initialize   Interface   Internal       Accessor   Attribute     Abstract                Getter
Schizophrenia




                  Regular    Constant

                Overriding   Delegating

                Extending    Setter

                  Abstract   Getter
Wannabe




            Regular    Constant

          Overriding   Delegating

          Extending    Setter

            Abstract   Getter
Gory Details

                  Regular

               Overriding

               Extending

                 Abstract

                Constant

               Delegating

                   Setter

                   Getter
Where’s the Beauty?
“Software is intangible,
having no physical shape or size.”




                                  Thomas Ball, Stephen Eick

                                  “Software Visualization in the
                                  Large”
                                  In Computer, vol. 29, no.4, pp. 33-43,
                                  IEEE Computer Society Press, 1996
The Best Defense is Attack
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

                                                 “Patterns of Software: Tales from the
                                                 Software Community”, Oxford University
                                                 Press, 1998.
Visualizing Software as 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
OK, so what?
applications
applications
applications
applications
Large-scale Program Comprehension
argoUML
0.28.1_01


packages
  198

 classes
  2,975

  lines
166,735
apache
  cocoon
Aug 27 2009


 packages
   784

  classes
   4,008

   lines
 173,436
frostwire
  r1223


packages
  391

 classes
  5,798

  lines
275,910
jitterbit
 r31527


packages
  945

classes
10,412

  lines
263,645
openswing
   r296


packages
  268

 classes
  1,754

   lines
 112,495
apache bcel
    5.2


 packages
    29

  classes
    550

   lines
  19,090
hsqldb
r 3154


packages
  103

classes
 1,209

  lines
158,208
vuze
 4.2.0.8


packages
  610

classes
 5,242

  lines
456,064
ScumVM
 (C++)


packages
   18

classes
 1,331

  lines
~105,000
Jun
(Smalltalk)


packages
  288

 classes
 2,2236

  lines
~351,000
10 systems
(Java,Smalltalk,
     C++)


   packages
     1,777

    classes
    17,090

     lines
  ~1,272,000
Understanding Evolution
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
The Time Machine




                       JMol

                       versions
                   57 (bi-monthly
                    snapshots)

                       time
                    1999-2007
The Time Machine




                       JMol

                       versions
                   57 (bi-monthly
                    snapshots)

                       time
                    1999-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 Fine-grained Age map
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Time Travel + Age Map




  October 2000
    March 2001
September 2001
                        JHotDraw
    March 2002
   August 2002           versions
  January 2003              8
     July 2003
                           time
  January 2004
                        40 months
Displaying Design Problems
JDK 1.5 God Classes
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
CodeCity   codecity.inf.usi.ch




                       2800+
                     downloads
Released
Mar 2008                free
CodeCity   codecity.inf.usi.ch




CodeCity




                       2800+
                     downloads
Released
Mar 2008                free
Part VI
Epilogue
Reflections
Reflections
Software Visualization is
Reflections
            Software Visualization is

a means to make the intangible tangible
Reflections
            Software Visualization is

a means to make the intangible tangible

                 not so difficult after all
Reflections
            Software Visualization is

a means to make the intangible tangible

                 not so difficult after all

                       still in its infancy
Reflections
            Software Visualization is

a means to make the intangible tangible

                 not so difficult after all

                       still in its infancy

              an exciting research area
Where do we go from here?
Software Visualization 101+
From here to..
Software Visualization 101+
Michele Lanza

REVEAL @ Faculty of Informatics
University of Lugano, Switzerland

More Related Content

PDF
The Visual Terminator
PDF
Let’s talk about microbenchmarking
PDF
Code em Poker
DOCX
PDF
Arduino coding class part ii
PDF
Arduino coding class
DOC
Ocr code
PDF
Matlab differential
The Visual Terminator
Let’s talk about microbenchmarking
Code em Poker
Arduino coding class part ii
Arduino coding class
Ocr code
Matlab differential

What's hot (17)

DOCX
Cg my own programs
PDF
Minerva_lib - fuzzing tool
ODP
Creating masterpieces with raphael
DOC
Ds 2 cycle
PPT
computer graphics practicals
PDF
Simpson and lagranje dalambair math methods
PDF
Fractal Rendering in Developer C++ - 2012-11-06
ODP
PDF
PDF
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
PPT
Drawing Figures
PDF
Степан Кольцов — Rust — лучше, чем C++
PDF
Computer graphics lab report with code in cpp
PDF
(Appendix_Codes) Game Programming Portfolio - Soobum Lee
PDF
Torturing the PHP interpreter
PPTX
Cg my own programs
Minerva_lib - fuzzing tool
Creating masterpieces with raphael
Ds 2 cycle
computer graphics practicals
Simpson and lagranje dalambair math methods
Fractal Rendering in Developer C++ - 2012-11-06
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Drawing Figures
Степан Кольцов — Rust — лучше, чем C++
Computer graphics lab report with code in cpp
(Appendix_Codes) Game Programming Portfolio - Soobum Lee
Torturing the PHP interpreter

Viewers also liked (18)

PDF
Software Visualization - Promises & Perils
PDF
Software Visualization Today - Systematic Literature Review
PDF
Software Quality Visualization
PDF
Perspectives on Software Visualization
PDF
A Pragmatic Perspective on Software Visualization
PDF
Visualizing Gnome with the Small Project Observatory
PDF
EvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
PPT
Beauty is in the Eye of the Beholder
PDF
Of Code and Change: Beautiful Software
PDF
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
PDF
Visualization for Software Analytics
PDF
Seeing Software
PDF
Smalltalk In a Nutshell
PDF
A Holistic Approach to Evolving Software Systems
PDF
Object-Oriented Metrics in Practice
PDF
Software Evolution Visualization
PDF
Software Evolution
PPTX
Source code visualization (SourceViz)
Software Visualization - Promises & Perils
Software Visualization Today - Systematic Literature Review
Software Quality Visualization
Perspectives on Software Visualization
A Pragmatic Perspective on Software Visualization
Visualizing Gnome with the Small Project Observatory
EvoSpaces - Multi-dimensional Navigation Spaces for Software Evolution
Beauty is in the Eye of the Beholder
Of Code and Change: Beautiful Software
A Teamwork-based Approach to Programming Fundamentals with Scheme, Smalltalk ...
Visualization for Software Analytics
Seeing Software
Smalltalk In a Nutshell
A Holistic Approach to Evolving Software Systems
Object-Oriented Metrics in Practice
Software Evolution Visualization
Software Evolution
Source code visualization (SourceViz)

Similar to Software Visualization 101+ (20)

PDF
AI CHALLENGE ADMIN
PPTX
TRICK
PPT
Dynamic programming
PDF
DOCX
rubik_solve
PPT
Advanced Search Techniques
PDF
Connect 4
KEY
「Frama-Cによるソースコード検証」 (mzp)
PDF
Shoot-for-A-Star
PPT
Chap11alg
PPT
Chap11alg
PDF
The following is my code for a connectn program. When I run my code .pdf
PPT
PPT
KEY
Coqによる暗号アルゴリズムの実装の安全性検証
PDF
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
PPT
Juegos minimax AlfaBeta
PDF
#include stdio.h #include string.h #include stdlib.h #in.pdf
PDF
Cse 402 offline b2
PPTX
8 queens problem using back tracking
AI CHALLENGE ADMIN
TRICK
Dynamic programming
rubik_solve
Advanced Search Techniques
Connect 4
「Frama-Cによるソースコード検証」 (mzp)
Shoot-for-A-Star
Chap11alg
Chap11alg
The following is my code for a connectn program. When I run my code .pdf
Coqによる暗号アルゴリズムの実装の安全性検証
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
Juegos minimax AlfaBeta
#include stdio.h #include string.h #include stdlib.h #in.pdf
Cse 402 offline b2
8 queens problem using back tracking

Software Visualization 101+

  • 1. Software Visualization 101+ Michele Lanza REVEAL @ Faculty of Informatics University of Lugano, Switzerland
  • 10. immersive fine-grained software software evolution visualization synchronous next-gen visual development programming software ecosystems bug analysis/prediction holistic evolution
  • 11. Immersive Software Visualization ‣ R. Wettel, M. Lanza; Program Comprehension through Software Habitability. In ICPC 2007 (15th IEEE International Conference on Program Comprehension), pp. 231 - 240, IEEE CS Press, 2007 ‣ R. Wettel, M. Lanza; Visualizing Software Systems as Cities. In VISSOFT 2007 (4th IEEE 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 Softvis 2008 (4th ACM International Symposium on Software Visualization), pp. 155 - 164, ACM Press, 2008 ‣ R. Wettel, M. Lanza; Visual Exploration of Large-scale System Evolution. In WCRE 2008 (15th IEEE Working Conference on Reverse Engineering), pp. 219 - 228, IEEE CS Press, 2008 Richard Wettel ‣ R. Wettel, M. Lanza; CodeCity: 3D Visualization of Evolving Large-Scale Software. In ICSE 2008 (30th ACM/IEEE International Conference on Software Engineering), pp. 921 - 922, ACM Press, 2008. CodeCity
  • 12. Goals
  • 13. Goals
  • 14. Goals
  • 15. Goals
  • 17. [Software is] anything but hardware, [...] the "soft" part is the intangible objects inside the computer.
  • 20. /***************************************************************************/ 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[]=".?+nkbrq?*?NKBRQ"; /* 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("%2d ply, %9d searched, %6d by (%2x,%2x) if(a->K) /* hit: pos. is in hash tab */ n",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(" %c",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 */ }
  • 24. 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
  • 25. 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.”
  • 27. z at ion isu ali ar ev so ftw n ot
  • 28. A picture is worth a thousand words
  • 29. ng ro thousand words w A picture is worth a
  • 33. the ith ly g w eral hin lit th et to ok ds too L UM and w or t ho us
  • 36. We are Visual Beings 70% of all brain inputs come through the eyes
  • 37. We see with our Brain ‣ 3 types of memory to process visual information ‣ Iconic, the visual sensory register ‣ Short-term, the working memory ‣ (Long-term)
  • 39. 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
  • 40. 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 of a limited set of attributes is very fast, automatic & subconscious, therefore called pre-attentive
  • 41. 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 of a limited set of attributes is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term Memory processes information as “chunks”
  • 42. 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 of a limited set of attributes is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term Memory processes information as “chunks” ‣ Storage is temporary and of limited capacity (3-9 chunks)
  • 43. 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 of a limited set of attributes is very fast, automatic & subconscious, therefore called pre-attentive ‣ Short-term Memory processes information as “chunks” ‣ Storage is temporary and of limited capacity (3-9 chunks) ‣ This explains why charts are more expressive than tables
  • 45. Pre-attentive Attributes of Form Orientation Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 46. Pre-attentive Attributes of Form Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 47. Pre-attentive Attributes of Form Line Width Size Shape Curvature Added Marks Enclosure
  • 48. Pre-attentive Attributes of Form Size Shape Curvature Added Marks Enclosure
  • 49. Pre-attentive Attributes of Form Shape Curvature Added Marks Enclosure
  • 50. Pre-attentive Attributes of Form Curvature Added Marks Enclosure
  • 51. Pre-attentive Attributes of Form Added Marks Enclosure
  • 52. Pre-attentive Attributes of Form Enclosure
  • 58. The Polymetric View Principle number of attributes number of number of methods lines of code
  • 62. The X-Ray Eclipse Plugin xray.inf.usi.ch 6800+ downloads Released Nov 2007 free
  • 65. The Class Blueprint Initialize Interface Internal Accessor Attribute invocation and access direction
  • 66. Detailing the Class Blueprint internal access Access external Attribute access Invocation Regular Constant invocations Overriding Delegating lines Method Extending Setter Initialize Interface Internal Accessor Attribute Abstract Getter
  • 67. Schizophrenia Regular Constant Overriding Delegating Extending Setter Abstract Getter
  • 68. Wannabe Regular Constant Overriding Delegating Extending Setter Abstract Getter
  • 69. Gory Details Regular Overriding Extending Abstract Constant Delegating Setter Getter
  • 71. “Software is intangible, having no physical shape or size.” Thomas Ball, Stephen Eick “Software Visualization in the Large” In Computer, vol. 29, no.4, pp. 33-43, IEEE Computer Society Press, 1996
  • 72. The Best Defense is Attack
  • 73. How can we solve Ball’s dilemma? Metaphors..
  • 74. “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 “Patterns of Software: Tales from the Software Community”, Oxford University Press, 1998.
  • 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
  • 80. 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
  • 88. argoUML 0.28.1_01 packages 198 classes 2,975 lines 166,735
  • 89. apache cocoon Aug 27 2009 packages 784 classes 4,008 lines 173,436
  • 90. frostwire r1223 packages 391 classes 5,798 lines 275,910
  • 91. jitterbit r31527 packages 945 classes 10,412 lines 263,645
  • 92. openswing r296 packages 268 classes 1,754 lines 112,495
  • 93. apache bcel 5.2 packages 29 classes 550 lines 19,090
  • 94. hsqldb r 3154 packages 103 classes 1,209 lines 158,208
  • 95. vuze 4.2.0.8 packages 610 classes 5,242 lines 456,064
  • 96. ScumVM (C++) packages 18 classes 1,331 lines ~105,000
  • 97. Jun (Smalltalk) packages 288 classes 2,2236 lines ~351,000
  • 98. 10 systems (Java,Smalltalk, C++) packages 1,777 classes 17,090 lines ~1,272,000
  • 100. 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
  • 101. The Time Machine JMol versions 57 (bi-monthly snapshots) time 1999-2007
  • 102. The Time Machine JMol versions 57 (bi-monthly snapshots) time 1999-2007
  • 103. 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
  • 105. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 106. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 107. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 108. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 109. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 110. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 111. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 112. Time Travel + Age Map October 2000 March 2001 September 2001 JHotDraw March 2002 August 2002 versions January 2003 8 July 2003 time January 2004 40 months
  • 114. JDK 1.5 God Classes
  • 115. Jmol’s Feature Envy Feature envy
  • 116. Jmol’s Feature Envy Feature envy 1,500 methods (25%)
  • 117. 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
  • 119. CodeCity codecity.inf.usi.ch 2800+ downloads Released Mar 2008 free
  • 120. CodeCity codecity.inf.usi.ch CodeCity 2800+ downloads Released Mar 2008 free
  • 124. Reflections Software Visualization is a means to make the intangible tangible
  • 125. Reflections Software Visualization is a means to make the intangible tangible not so difficult after all
  • 126. Reflections Software Visualization is a means to make the intangible tangible not so difficult after all still in its infancy
  • 127. Reflections Software Visualization is a means to make the intangible tangible not so difficult after all still in its infancy an exciting research area
  • 128. Where do we go from here?
  • 131. Software Visualization 101+ Michele Lanza REVEAL @ Faculty of Informatics University of Lugano, Switzerland