SlideShare une entreprise Scribd logo
1  sur  223
Télécharger pour lire hors ligne
Pragmatic Design Quality Assessment


                  Tudor Gîrba
            University of Bern, Switzerland

                 Michele Lanza
           University of Lugano, Switzerland

                Radu Marinescu
      Politehnica University of Timisoara, Romania
1946
1951
1951
1951
1951
1951   2008
1951   2008
1951   2008
?
1951   2008
Software is complex.



   29% Succeeded

      18% Failed



   53% Challenged



 The Standish Group, 2004
How large is your project?
How large is your project?


    1’000’000 lines of code
How large is your project?


    1’000’000 lines of code
    * 2 = 2’000’000 seconds
How large is your project?


    1’000’000 lines of code
    * 2 = 2’000’000 seconds
      / 3600 = 560 hours
How large is your project?


    1’000’000 lines of code
    * 2 = 2’000’000 seconds
      / 3600 = 560 hours
         / 8 = 70 days
How large is your project?


    1’000’000 lines of code
    * 2 = 2’000’000 seconds
      / 3600 = 560 hours
         / 8 = 70 days
       / 20 = 3 months
But, code is for the computer.
Why would we ever read it?
}
                                                 }
                                             {
                                             {



                                                 }
                                                 }
                                             {
                                             {




                                         g
                                   rin
                              ee
                        gin
                   en
               d
          ar
     rw
fo
fo
                                             rw
                                              ar
                                                d
                                                  en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
What is the current state?




                                           fo
                                             rw
                                              ar
What should we do?




                                                d
                                                  en
Where to start?




                                                     gin
                                                      ee
How to proceed?




                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                                               rw
                                              g
                                            rin




                                                                ar
                                         ee




                                                                  d
                                        gin




                                                                    en
                                                                       gin
                                       en




                                                                        ee
                                   se




                                                                         rin
                                 erv




                                                                             g
                                re




{               {
    {                   {                                                        {               {
                            }                                                        {               {
        }
        }                                         actual development                     }               }
            }       {       }                                                                }               }
Reverse engineering is analyzing a subject system to:
 identify components and their relationships, and
 create more abstract representations.




                                 Chikofky & Cross, 90
{               {
                  {                   {
                                          }
                      }
                      }
                          }       {       }




A large system contains lots of details.
ity?
                  its qual
         ju dge
How to                 {               {
                           {                   {
                                                   }
                               }
                               }
                                   }       {       }




    A large system contains lots of details.
http://moose.unibe.ch




http://loose.upt.ro/incode
1
Software in
               2
              Software in
 numbers       pictures




 3
Software in
               4
              Software in
   time          tools
Software in numbers




                      1
Youcannot control
what you cannot measure.




                           Tom de Marco
Metrics are functions that assign numbers to
products, processes and resources.
Software metrics are measurements which
relate to software systems, processes or
related documents.
Metrics compress system traits into numbers.
Let’s see some examples...
Examples of size metrics


NOM - number of methods
NOA - number of attributes
LOC - number of lines of code
NOS - number of statements
NOC - number of children



                                      Lorenz, Kidd, 1994
                                Chidamber, Kemerer, 1994
McCabe cyclomatic complexity (CYCLO) counts
the number of independent paths through the code of a
function.

                                                         McCabe, 1977




  it reveals the minimum number of tests to write

  interpretation can’t directly lead to improvement action
Weighted Method Count (WMC) sums up the
complexity of class’ methods (measured by the metric
of your choice; usually CYCLO).

                                             Chidamber, Kemerer, 1994




  it is configurable, thus adaptable to our precise needs

  interpretation can’t directly lead to improvement action
Depth of Inheritance Tree (DIT) is the (maximum)
depth level of a class in a class hierarchy.


                                             Chidamber, Kemerer, 1994




  inheritance is measured

  only the potential and not the real impact is quantified
Coupling between objects (CBO) shows the number
of classes from which methods or attributes are used.


                                              Chidamber, Kemerer, 1994




  it takes into account real dependencies not just declared ones

  no differentiation of types and/or intensity of coupling
Tight Class Cohesion (TCC) counts the relative
number of method-pairs that access attributes of the
class in common.

                                                   Bieman, Kang, 1995


         TCC = 2 / 10 = 0.2




  interpretation can lead to improvement action

  ratio values allow comparison between systems
...
McCall, 1977
Metrics Assess and Improve Quality!
Metrics Assess and Improve Quality!




                     a lly ?
              Re
McCall, 1977
Problem 1: metrics granularity




                                           ?
capture symptoms, not causes of problems

in isolation,
they don’t lead to improvement solutions
Problem 1: metrics granularity




                                           ?
capture symptoms, not causes of problems

in isolation,
they don’t lead to improvement solutions




Problem 2: implicit mapping
we don’t reason in terms of metrics,
but in terms of design principles
2   big obstacles in using metrics:


     Thresholds make metrics hard to interpret

     Granularity make metrics hard to use in isolation
Can metrics help me
             in what I really care for? :)
fo
                                             rw
                                              ar
                                                d
                                                  en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                             rw
How do I understand code?




                                              ar
                                                d
                                                  en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                             rw
How do I understand code?




                                              ar
                                                d
How do I improve code?




                                                  en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                             rw
How do I understand code?




                                              ar
                                                d
How do I improve code?




                                                  en
                                                     gin
How do I improve myself?




                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
etr ics!
                                               w ith m
                                        o do
                                  i ng t
                            tn oth
            I wan




                                                                 fo
                                                                 rw
How do I understand code?




                                                                  ar
                                                                      d
How do I improve code?




                                                                      en
                                                                          gin
How do I improve myself?




                                                                           ee
                                                                            rin
                                                                                g
{               {
    {                   {                                                           {               {
                            }                                                           {               {
        }
        }                                       actual development                          }               }
            }       {       }                                                                   }               }
How to get an initial   understanding of a system?
Metric   Value
LOC      35175
NOM       3618
NOC        384
CYCLO     5579
NOP         19
CALLS    15128
FANOUT    8590
AHH        0.12
ANDC       0.31
Metric   Value
LOC      35175
NOM       3618
NOC        384
CYCLO     5579
NOP         19
CALLS    15128
FANOUT    8590
AHH        0.12
ANDC       0.31
Metric               Value
LOC                  35175
NOM                   3618
NOC                    384
CYCLO                 5579
NOP                     19
CALLS                15128
FANOUT                8590
                  ha t?
                ww
AHH
         An d no       0.12
ANDC                   0.31
We need means to compare.
hierarchies?

               coupling?
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006


                                  Inheritance
                                 ANDC      0.31
                                 AHH       0.12
                         20.21   NOP         19
               9.42      NOC                384
        9.72   NOM                         3618    NOM        418
0.15    LOC                               35175 15128       CALLS      0.56
CYCLO                                      5579 8590                FANOUT

                      Size                              Communication
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006




                                 ANDC    0.31
                                 AHH     0.12
                         20.21   NOP       19
               9.42      NOC              384
        9.72   NOM                       3618    NOM     418
0.15    LOC                             35175 15128    CALLS      0.56
CYCLO                                    5579 8590             FANOUT

                      Size
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006




                              ANDC    0.31
                              AHH     0.12
                      20.21   NOP       19
               9.42   NOC              384
        9.72   NOM                    3618    NOM        418
0.15    LOC                          35175 15128       CALLS      0.56
CYCLO                                 5579 8590                FANOUT

                                                   Communication
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006


                               Inheritance
                              ANDC      0.31
                              AHH       0.12
                      20.21   NOP         19
               9.42   NOC                384
        9.72   NOM                      3618    NOM     418
0.15    LOC                            35175 15128    CALLS      0.56
CYCLO                                   5579 8590             FANOUT
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006




                              ANDC    0.31
                              AHH     0.12
                      20.21   NOP       19
               9.42   NOC              384
        9.72   NOM                    3618    NOM     418
0.15    LOC                          35175 15128    CALLS      0.56
CYCLO                                 5579 8590             FANOUT
Java                 C++
            LOW    AVG    HIGH   LOW    AVG    HIGH

CYCLO/LOC   0.16   0.20   0.24   0.20   0.25   0.30

LOC/NOM      7      10     13     5     10      16

NOM/NOC      4      7      10     4      9      15

   ...
The Overview Pyramid provides a metrics
  overview.                         Lanza, Marinescu 2006




                                 ANDC           0.31
                                 AHH            0.12
                         20.21   NOP              19
                  9.42   NOC                     384
          9.72    NOM                           3618    NOM       418
0.15      LOC                               35175 15128         CALLS      0.56
CYCLO                                           5579 8590               FANOUT




       close to high         close to average               close to low
The Overview Pyramid provides a metrics
overview.                         Lanza, Marinescu 2006




 close to high     close to average     close to low
fo
                                             rw
How do I understand code?




                                              ar
                                                d
How do I improve code?




                                                  en
                                                     gin
How do I improve myself?




                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
etr ics!
                                             w ith m
                                      o do
                                i ng t
                            oth
                        nt n
            I wa




                                                               fo
                                                               rw
How do I understand code?




                                                                ar
                                                                    d
How do I improve code?




                                                                    en
                                                                        gin
How do I improve myself?




                                                                         ee
                                                                          rin
                                                                              g
{               {
    {                   {                                                         {               {
                            }                                                         {               {
        }
        }                                     actual development                          }               }
            }       {       }                                                                 }               }
How do I improve code?
Quality is more than 0 bugs.



Breaking design principles, rules and best practices
          deteriorates the code;
          it leads to design problems.
Imagine changing just a small design fragment
Imagine changing just a small design fragment
Imagine changing just a small design fragment




and33%
of all classes
would require changes
expensive
Design problems
are frequent
                    unavoidable
expensive
Design problems
are frequent
                    unavoidable


                                                           th em?
                                                     ate
                                               limin
                                           nd e
                                ete ct a
                         to d
                     How
God Classes tend to centralize the intelligence of the
system, to do everything and to use data from small
data-classes.
                                                Riel, 1996
God Classes tend
    to centralize the intelligence of the system,
    to do everything and
    to use data from small data-classes.
God Classes
    centralize the intelligence of the system,
    do everything and
    use data from small data-classes.
God Classes
    are complex,
    are not cohesive,
    access external data.
God Classes
    are complex,
    are not cohesive,
    access external data.

                                                    sing
                                          uer ies u
                                      to q s
                                  s in ator
                             etric per
                         se m ical o
                   Co mpo log
Detection Strategies are metric-based queries to
detect design flaws.                  Lanza, Marinescu 2006




                  Rule 1


          METRIC 1 > Threshold 1

                                   AND   Quality problem

                  Rule 2


          METRIC 2 < Threshold 2
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                                  Lanza, Marinescu 2006

   Identity               Collaboration            Classification
Disharmonies              Disharmonies             Disharmonies
A God Class centralizes too much intelligence in
the system.                         Lanza, Marinescu 2006


       Class uses directly more than a
       few attributes of other classes

               ATFD > FEW




        Functional complexity of the
             class is very high
                                         AND   GodClass
            WMC ! VERY HIGH




           Class cohesion is low


            TCC < ONE THIRD
An Envious Method is more interested in data
from a handful of classes.         Lanza, Marinescu 2006


      Method uses directly more than
      a few attributes of other classes

               ATFD > FEW




      Method uses far more attributes
       of other classes than its own
                                          AND   Feature Envy
            LAA < ONE THIRD




        The used quot;foreignquot; attributes
      belong to very few other classes

                FDP ! FEW
Data Classes are dumb data holders.
                                                  Lanza, Marinescu 2006




        Interface of class reveals data
         rather than offering services

            WOC < ONE THIRD
                                            AND    Data Class


     Class reveals many attributes and is
                not complex
Data Classes are dumb data holders.
                                             Lanza, Marinescu 2006

     More than a few public
             data

     NOAP + NOAM > FEW
                                 AND
    Complexity of class is not
              high

          WMC < HIGH
                                            Class reveals many
                                       OR   attributes and is not
     Class has many public                         complex
             data

    NOAP + NOAM > MANY
                                 AND
    Complexity of class is not
          very high

      WMC < VERY HIGH
fo
                                             rw
                                              ar
                                                d
                                                  en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                             rw
How do I understand code?




                                              ar
                                                d
How do I improve code?




                                                  en
                                                     gin
How do I improve myself?




                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
How do I improve myself?
Follow a clear and repeatable process
Follow a clear and repeatable process
Follow a clear and repeatable process
Follow a clear and repeatable process



                                                     mb ers!
                                              so f nu
                                       in term
                            qu ality
                   ab out
         re ason
D on’t
QA is part of the the Development Process




         http://loose.upt.ro/incode
Can we understand the beauty of a painting
by measuring its frame or counting its colors?
1
Software in
               2
              Software in
 numbers       pictures




 3
Software in
               4
              Software in
   time          tools
Software in pictures




                       2
Software is beautiful
1854,
London,
cholera
epidemic
1812, Napoleon’s Campaign in Russia
Numbers..
Numbers..
Numbers..




                                ANDC       0.31
                                AHH        0.12
                      20.21     NOP          19
               9.42   NOC                   384
        9.72   NOM                         3618    NOM     418
0.15    LOC                               35175 15128    CALLS      0.56
CYCLO                                      5579 8590             FANOUT
Visualization compresses the system into pictures.
A picture is worth

a   thousand words... anonymous




...depends on the picture
                     Lanza
U ML
                                        han
                                mo re t
                     tio n is
                 liza
            isua
    wa re v
Soft
We are

visual
beings ...


... and we’re
good at
spotting
patterns
How many groups do you see?
How many groups do you see?
How many groups do you see?
How many groups do you see?
Gestalt principles




proximity                        similarity




enclosure                        connectivity
More Gestalt principles




closure                             continuity
We do not see with our eyes, but with our brain.

 Our brain works like a computer, with 3 types of memory
   Iconic memory, the visual sensory register
   Short-term memory, the working memory
   Long-term memory

                                Sensation                                    Perception
                                (Physical Process)                            (Cognitive Process)




                         Stimulus               Sensory Organ              Perceptual Organ




                                                                                      Brain
                                                                Iconic Memory - Short-term Memory - Long-term Memory
Iconic   Short-term
memory     memory
Iconic         Short-term
memory           memory




< 1 second
very fast
automatic
subconscious
preattentive
Iconic             Short-term
memory               memory




< 1 second     couple of seconds
very fast             3-9 chunks
automatic
subconscious
preattentive
Categorizing Preattentive Attributes

Category          Form        Color       Spatial Motion   Motion

                Orientation     Hue         2D position     Flicker

                Line length   Intensity                    Direction

                Line width

                   Size
Attribute
                  Shape

                Curvature

               Added marks

                Enclosure
Attributes of Form




Orientation   Line Length   Line Width      Size




  Shape       Curvature     Added Marks   Enclosure
Attributes of Form




        Line Length   Line Width      Size




Shape   Curvature     Added Marks   Enclosure
Attributes of Form




                    Line Width      Size




Shape   Curvature   Added Marks   Enclosure
Attributes of Form




                                    Size




Shape   Curvature   Added Marks   Enclosure
Attributes of Form




Shape   Curvature   Added Marks   Enclosure
Attributes of Form




Curvature   Added Marks   Enclosure
Attributes of Form




          Added Marks   Enclosure
Attributes of Form




                     Enclosure
Attributes of Form
Exemplifying Preattentive Processing
Exemplifying Preattentive Processing



8789364082376403128764532984732984732094873290845
389274-0329874-32874-23198475098340983409832409832
049823-0984903281453209481-0839393947896587436598
Exemplifying Preattentive Processing



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



8789364082376403128764532984732984732094873290845
389274-0329874-32874-23198475098340983409832409832
049823-0984903281453209481-0839393947896587436598
70%
of all external
inputs come
through the eyes
Software visualization is
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.
                                                 Price, Becker, Small
Static Visualization
Dynamic Visualization
llet
           r bu
no silve
Software is complex
Software is complex
A picture is worth

a   thousand words.
era lly :)
       ok it lit
   L to
UM
Example: what is   ?
Polymetric Views show up to 5 metrics.
                                            Lanza, 2003

                        Width metric

        Height metric



  Position metrics

                                   Color
                                   metric
A simple & powerful concept

                               LOC




NOS
                                             parameters


                                parameters      lines
System Complexity shows class hierarchies.
                                        Lanza, Ducasse, 2003




                                          attributes


                              methods       lines
Class Blueprint shows class internals.
                                                      Lanza, Ducasse, 2005


   Initialize   Interface       Internal       Accessor   Attribute




                   invocation and access direction
Class Blueprint has a rich vocabulary.

              internal access
                                              Access
  external
                Attribute
   access                                    Invocation



                                   Regular                Constant

               invocations
                                Overriding                Delegating

      lines      Method
                                Extending                 Setter

                                  Abstract                Getter
Class Blueprint reveals patterns.




         twin classes               schizophrenic class
Distribution Map shows properties over
structure.                            Ducasse etal, 2006




            31 parts, 394 elements and 9 properties
Softwarenaut explores the package structure.
                                        Lungu etal, 2006
Code City shows where your code lives.
                                                       Wettel, Lanza, 2007




       classes are buildings grouped in quarters of packages
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Jmol - The Time Machine
Software is beautiful
1
Software in
               2
              Software in
 numbers       pictures




 3
Software in
               4
              Software in
   time          tools
Software in time




                   3
fo
                                                               rw
                                              g
                                            rin




                                                                ar
                                         ee




                                                                  d
                                        gin




                                                                    en
                                                                       gin
                                       en




                                                                        ee
                                   se




                                                                         rin
                                 erv




                                                                             g
                                re




{               {
    {                   {                                                        {               {
                            }                                                        {               {
        }
        }                                         actual development                     }               }
            }       {       }                                                                }               }
{
                         {
    } }
}
                         {



{
                         {
                }

}
                                re
                                   v  er
                                           se
                                                 en
                                                      gin
                                                            ee
                                                                 rin
                                                                       g


                             reverse engineering

                                                                           fo
    actual development                                               rw
                                                                ar
                                                            d
                                                       en
                                                 gin
                                            ee
                                      rin
                                  g
                         {
             {
    }
}
                         {
             {
    }
}
{               {
                  {                   {
                                          }
                      }
                      }
                          }       {       }




A large system contains lots of details.
{               {               {               {               {               {               {               {               {               {
    {                   {           {                   {           {                   {           {                   {           {                   {
                            }                               }                               }                               }                               }
        }
        }                               }
                                        }                               }
                                                                        }                               }
                                                                                                        }                               }
                                                                                                                                        }
            }       {       }               }       {       }               }       {       }               }       {       }               }       {       }




The history of a large system contains even more details.
Most often time is put on the horizontal
  and a property on the vertical axis.




              Lehman etal, 2001
Spectographs show change activity.
                              Wu etal, 2004




 commit




                  time
Evolution Matrix shows changes in classes.
                                      Lanza, Ducasse, 2002


Idle class



Pulsar class




Supernova class




White dwarf class
Evolution Matrix shows changes in classes.
                                  Lanza, Ducasse, 2002
History can be measured.
What changed? When did it change? ...


      2     4     3     5    7


      2     2     3     4    9


      2     2     1     2    3


      2     2     2     2    2


      1     5     3     4    4
Evolution of
Number of Methods               LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n




    LENOM(C)    =       4   +    2   +   1   +   0   =   7

                    1       5        3       4       4
Latest Evolution of
Number of Methods               LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n


Earliest Evolution of
Number of Methods               EENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 22-i




                        -3   -2   -1   0
     LENOM(C)       = 42 + 22 + 12 + 02 =              1.5

                        1   5        3      4      4

     EENOM(C)       = 4 20 + 2 2-1 + 1 2-2 + 0 2-3 =   5.25
ENOM   LENOM EENOM


2   4   3   5   7    7      3.5    3.25


2   2   3   4   9    7      5.75   1.37


2   2   1   2   3    3       1      2


2   2   2   2   2    0       0      0


1   5   3   4   4    7      1.25   5.25
ENOM   LENOM EENOM


balanced changer    7      3.5    3.25


  late changer      7      5.75   1.37


                    3       1      2


  dead stable       0       0      0


 early changer      7      1.25   5.25
ENOM   LENOM EENOM


balanced changer                   7      3.5    3.25


  late changer                     7      5.75   1.37

                                   ed.
                             measur3       1      2
                          be
                 ry can
         H isto
  dead stable                      0       0      0


 early changer                     7      1.25   5.25
History can be measured in many ways.




Evolution                       Number of Methods
Stability                    Number of Lines of Code
Historical Max      of        Cyclomatic Complexity
Growth Trend                    Number of Modules
...                                                ...
The recently changed parts are likely to change in the
near future.

                                        Common wisdom
The recently changed parts are likely to change in the
near future.


                                ally?
                                        Common wisdom
                             re
                   re they
                 A
30%   90%
present
past




       present
past             future




       present
past             future




       present
past             future




       present
past             future


YesterdayWeatherHit(present):

 past:=histories.topLENOM(start, present)

 future:=histories.topEENOM(present, end)

 past.intersectWith(future).notEmpty()




                                                   present
past             future


YesterdayWeatherHit(present):

 past:=histories.topLENOM(start, present)

 future:=histories.topEENOM(present, end)

 past.intersectWith(future).notEmpty()




                                                        present
                                prediction hit
Yesterday’s Weather shows the localization of changed in
time.                                          Girba etal, 2004




 hit               hit                hit

                                             YW = 3 / 8 = 37%




 hit         hit   hit    hit   hit   hit   hit

                                             YW = 7 / 8 = 87%
A God Class centralizes too much intelligence in
the system.

      Class uses directly more than a
      few attributes of other classes

              ATFD > FEW




       Functional complexity of the
            class is very high
                                        AND   GodClass
           WMC ! VERY HIGH




          Class cohesion is low


           TCC < ONE THIRD
A God Class centralizes too much intelligence in
the system.

      Class uses directly more than a
      few attributes of other classes

              ATFD > FEW


                                                  tab le?
                                         f it is s
                                  wh
       Functional complexity of the  at i
                           ut,
            class is very high
                         B                     AND          GodClass
           WMC ! VERY HIGH




          Class cohesion is low


           TCC < ONE THIRD
History-based Detection Strategies take evolution
into account.                            Ratiu etal, 2004




              God Class
          in the last version

           isGodClass(last)


                                AND   Harmless God Class


          Stable throughout
             the history

           Stability > 90%
What happens with inheritance?

  A                 A                A                A                A




         B    C            B   C            B   C            B                B




                               D                D                D            E


ver .1            ver. 2           ver. 3           ver. 4           ver. 5


      A is persistent, B is stable, C was removed, E is newborn ...
Hierarchy Evolution encapsulates time.
                                                        Girba etal, 2005
              A
                                                        changed
                                                        methods

                                            changed
                                                           age
                                              lines
    C                      B

                                                    Removed

                                                    Removed
   D                   E



A is persistent, B is stable, C was removed, E is newborn ...
Hierarchy Evolution reveals patterns.
                                   Girba etal, 2005
Co-change analysis recovers hidden dependencies.
               Time is the lines.




                  Gall etal, 2003
Evolution Radar shows co-change relationships.
                                                 D’Ambros, Lanza 2006




          one package and its co-change relationships
Software is developed by people.
CVS shows activity.
Who is responsible for this?
Who is responsible for this?
Alphabetical order is no order.
Ownership Map reveals development patterns.
                                      Girba etal, 2006
JEdit
Ant
Who copied from whom?

(john     23.06.03) public boolean stillValid (ToDoItem I, Designer dsgr) {
(bill     09.01.05)    if (!isActive()) {
(bill     09.01.05)       return false
(bill     09.01.05)    }
(steve    16.02.05)    List offs = i.getOffenders();
(john     23.06.03)    Object dm = offs.firstElement();
(steve    16.02.05)    ListSet newOffs = computeOffenders(dm);
(john     23.06.03)    boolean res = offs.equals(newOffs);
(john     23.06.03)    return res;




(george   13.02.05) public boolean stillValid (ToDoItem I, Designer dsgr) {
(bill     11.13.05)    if (!isActive()) {
(bill     11.13.05)       return false
(bill     11.13.05)    }
(steve    16.02.05)    List offs = i.getOffenders();
(george   13.02.05)    Object dm = offs.firstElement();
(steve    16.02.05)    ListSet newOffs = computeOffenders(dm);
(george   13.02.05)    boolean res = offs.equals(newOffs);
(george   13.02.05)    return res;
What is useless?

(john     23.06.03) public boolean stillValid (ToDoItem I, Designer dsgr) {
(bill     09.01.05)    if (!isActive()) {
(bill     09.01.05)       return false
(bill     09.01.05)    }
(steve    16.02.05)    List offs = i.getOffenders();
(john     23.06.03)    Object dm = offs.firstElement();
(steve    16.02.05)    ListSet newOffs = computeOffenders(dm);
(john     23.06.03)    boolean res = offs.equals(newOffs);
(john     23.06.03)    return res;




(george   13.02.05) public boolean stillValid (ToDoItem I, Designer dsgr) {
(bill     11.13.05)    if (!isActive()) {
(bill     11.13.05)       return false
(bill     11.13.05)    }
(steve    16.02.05)    List offs = i.getOffenders();
(george   13.02.05)    Object dm = offs.firstElement();
(steve    16.02.05)    ListSet newOffs = computeOffenders(dm);
(george   13.02.05)    boolean res = offs.equals(newOffs);
(george   13.02.05)    return res;
When did changes happen?

23.06.03   public boolean stillValid (ToDoItem I, Designer dsgr) {
09.01.05      if (!isActive()) {
09.01.05         return false
09.01.05      }
16.02.05      List offs = i.getOffenders();
23.06.03      Object dm = offs.firstElement();
16.02.05      ListSet newOffs = computeOffenders(dm);
23.06.03      boolean res = offs.equals(newOffs);
23.06.03      return res;




13.02.05   public boolean stillValid (ToDoItem I, Designer dsgr) {
11.13.05      if (!isActive()) {
11.13.05         return false
11.13.05      }
16.02.05      List offs = i.getOffenders();
13.02.05      Object dm = offs.firstElement();
16.02.05      ListSet newOffs = computeOffenders(dm);
13.02.05      boolean res = offs.equals(newOffs);
13.02.05      return res;
Clone Evolution shows how developers copy.
                                      Balint etal, 2006
{
                         {
    } }
}
                         {



{
                         {
                }

}
                                re
                                   v  er
                                           se
                                                 en
                                                      gin
                                                            ee
                                                                 rin
                                                                       g


                             reverse engineering

                                                                           fo
    actual development                                               rw
                                                                ar
                                                            d
                                                       en
                                                 gin
                                            ee
                                      rin
                                  g
                         {
             {
    }
}
                         {
             {
    }
}
1
Software in
               2
              Software in
 numbers       pictures




 3
Software in
               4
              Software in
   time          tools
Software in tools




                    4
http://moose.unibe.ch




                                http://loose.upt.ro/incode




http://www.inf.unisi.ch/phd/wettel/codecity.html
Pragmatic Design Quality Assessment


                  Tudor Gîrba
            University of Bern, Switzerland

                 Michele Lanza
           University of Lugano, Switzerland

                Radu Marinescu
      Politehnica University of Timisoara, Romania
Tudor Gîrba, Michele Lanza, Radu Marinescu




http://creativecommons.org/licenses/by/3.0/

Contenu connexe

Similaire à Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)

05 Problem Detection
05 Problem Detection05 Problem Detection
05 Problem DetectionJorge Ressia
 
Modeling History to Understand Software Evolution with Hismo 2008-03-12
Modeling History to Understand Software Evolution with Hismo 2008-03-12Modeling History to Understand Software Evolution with Hismo 2008-03-12
Modeling History to Understand Software Evolution with Hismo 2008-03-12Tudor Girba
 
Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Tudor Girba
 
Enhancing agile development through software assessment
Enhancing agile development through software assessmentEnhancing agile development through software assessment
Enhancing agile development through software assessmentTudor Girba
 
Reverse Engineering 2007-11-27
Reverse Engineering 2007-11-27 Reverse Engineering 2007-11-27
Reverse Engineering 2007-11-27 Tudor Girba
 
Assessing software systems
Assessing software systemsAssessing software systems
Assessing software systemsTudor Girba
 
Humane assessment with Moose at Benevol 2010
Humane assessment with Moose at Benevol 2010Humane assessment with Moose at Benevol 2010
Humane assessment with Moose at Benevol 2010Tudor Girba
 
Helping you reengineering your legacy
Helping you reengineering your legacyHelping you reengineering your legacy
Helping you reengineering your legacyStéphane Ducasse
 
What history can tell us
What history can tell usWhat history can tell us
What history can tell usTudor Girba
 
Software understanding in the large (EVO 2008)
Software understanding in the large (EVO 2008)Software understanding in the large (EVO 2008)
Software understanding in the large (EVO 2008)Tudor Girba
 
Holistic software assessment at the University of Zurich
Holistic software assessment at the University of ZurichHolistic software assessment at the University of Zurich
Holistic software assessment at the University of ZurichTudor Girba
 
Restructuring (EVO 2008)
Restructuring (EVO 2008)Restructuring (EVO 2008)
Restructuring (EVO 2008)Tudor Girba
 
History Analysis (EVO 2008)
History Analysis (EVO 2008)History Analysis (EVO 2008)
History Analysis (EVO 2008)Tudor Girba
 
Software in Pictures 2008-03-12
Software in Pictures 2008-03-12Software in Pictures 2008-03-12
Software in Pictures 2008-03-12Tudor Girba
 
Reverse Engineering Techniques 2007-11-29
Reverse Engineering Techniques 2007-11-29 Reverse Engineering Techniques 2007-11-29
Reverse Engineering Techniques 2007-11-29 Tudor Girba
 
The humane software assessment (Choose Forum 2009)
The humane software assessment (Choose Forum 2009)The humane software assessment (Choose Forum 2009)
The humane software assessment (Choose Forum 2009)Tudor Girba
 
A Moose Slideshow
A Moose SlideshowA Moose Slideshow
A Moose SlideshowTudor Girba
 

Similaire à Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008) (18)

05 Problem Detection
05 Problem Detection05 Problem Detection
05 Problem Detection
 
Modeling History to Understand Software Evolution with Hismo 2008-03-12
Modeling History to Understand Software Evolution with Hismo 2008-03-12Modeling History to Understand Software Evolution with Hismo 2008-03-12
Modeling History to Understand Software Evolution with Hismo 2008-03-12
 
Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)
 
Moose Overview
Moose OverviewMoose Overview
Moose Overview
 
Enhancing agile development through software assessment
Enhancing agile development through software assessmentEnhancing agile development through software assessment
Enhancing agile development through software assessment
 
Reverse Engineering 2007-11-27
Reverse Engineering 2007-11-27 Reverse Engineering 2007-11-27
Reverse Engineering 2007-11-27
 
Assessing software systems
Assessing software systemsAssessing software systems
Assessing software systems
 
Humane assessment with Moose at Benevol 2010
Humane assessment with Moose at Benevol 2010Humane assessment with Moose at Benevol 2010
Humane assessment with Moose at Benevol 2010
 
Helping you reengineering your legacy
Helping you reengineering your legacyHelping you reengineering your legacy
Helping you reengineering your legacy
 
What history can tell us
What history can tell usWhat history can tell us
What history can tell us
 
Software understanding in the large (EVO 2008)
Software understanding in the large (EVO 2008)Software understanding in the large (EVO 2008)
Software understanding in the large (EVO 2008)
 
Holistic software assessment at the University of Zurich
Holistic software assessment at the University of ZurichHolistic software assessment at the University of Zurich
Holistic software assessment at the University of Zurich
 
Restructuring (EVO 2008)
Restructuring (EVO 2008)Restructuring (EVO 2008)
Restructuring (EVO 2008)
 
History Analysis (EVO 2008)
History Analysis (EVO 2008)History Analysis (EVO 2008)
History Analysis (EVO 2008)
 
Software in Pictures 2008-03-12
Software in Pictures 2008-03-12Software in Pictures 2008-03-12
Software in Pictures 2008-03-12
 
Reverse Engineering Techniques 2007-11-29
Reverse Engineering Techniques 2007-11-29 Reverse Engineering Techniques 2007-11-29
Reverse Engineering Techniques 2007-11-29
 
The humane software assessment (Choose Forum 2009)
The humane software assessment (Choose Forum 2009)The humane software assessment (Choose Forum 2009)
The humane software assessment (Choose Forum 2009)
 
A Moose Slideshow
A Moose SlideshowA Moose Slideshow
A Moose Slideshow
 

Plus de Tudor Girba

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismTudor Girba
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Tudor Girba
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Tudor Girba
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Tudor Girba
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cardsTudor Girba
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingTudor Girba
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks laterTudor Girba
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Tudor Girba
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomTudor Girba
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeTudor Girba
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Tudor Girba
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systemsTudor Girba
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Tudor Girba
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Tudor Girba
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Tudor Girba
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaserTudor Girba
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Tudor Girba
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Tudor Girba
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Tudor Girba
 

Plus de Tudor Girba (20)

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalism
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
 
GT Spotter
GT SpotterGT Spotter
GT Spotter
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cards
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective Thinking
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks later
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development room
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading code
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systems
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaser
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011
 

Dernier

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Dernier (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)

  • 1. Pragmatic Design Quality Assessment Tudor Gîrba University of Bern, Switzerland Michele Lanza University of Lugano, Switzerland Radu Marinescu Politehnica University of Timisoara, Romania
  • 7. 1951 2008
  • 8. 1951 2008
  • 9. 1951 2008
  • 10. ? 1951 2008
  • 11. Software is complex. 29% Succeeded 18% Failed 53% Challenged The Standish Group, 2004
  • 12. How large is your project?
  • 13. How large is your project? 1’000’000 lines of code
  • 14. How large is your project? 1’000’000 lines of code * 2 = 2’000’000 seconds
  • 15. How large is your project? 1’000’000 lines of code * 2 = 2’000’000 seconds / 3600 = 560 hours
  • 16. How large is your project? 1’000’000 lines of code * 2 = 2’000’000 seconds / 3600 = 560 hours / 8 = 70 days
  • 17. How large is your project? 1’000’000 lines of code * 2 = 2’000’000 seconds / 3600 = 560 hours / 8 = 70 days / 20 = 3 months
  • 18. But, code is for the computer. Why would we ever read it?
  • 19. } } { { } } { { g rin ee gin en d ar rw fo
  • 20. fo rw ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 21. What is the current state? fo rw ar What should we do? d en Where to start? gin ee How to proceed? rin g { { { { { { } { { } } actual development } } } { } } }
  • 22. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
  • 23. Reverse engineering is analyzing a subject system to: identify components and their relationships, and create more abstract representations. Chikofky & Cross, 90
  • 24. { { { { } } } } { } A large system contains lots of details.
  • 25. ity? its qual ju dge How to { { { { } } } } { } A large system contains lots of details.
  • 27. 1 Software in 2 Software in numbers pictures 3 Software in 4 Software in time tools
  • 29. Youcannot control what you cannot measure. Tom de Marco
  • 30. Metrics are functions that assign numbers to products, processes and resources.
  • 31. Software metrics are measurements which relate to software systems, processes or related documents.
  • 32. Metrics compress system traits into numbers.
  • 33. Let’s see some examples...
  • 34. Examples of size metrics NOM - number of methods NOA - number of attributes LOC - number of lines of code NOS - number of statements NOC - number of children Lorenz, Kidd, 1994 Chidamber, Kemerer, 1994
  • 35. McCabe cyclomatic complexity (CYCLO) counts the number of independent paths through the code of a function. McCabe, 1977  it reveals the minimum number of tests to write  interpretation can’t directly lead to improvement action
  • 36. Weighted Method Count (WMC) sums up the complexity of class’ methods (measured by the metric of your choice; usually CYCLO). Chidamber, Kemerer, 1994  it is configurable, thus adaptable to our precise needs  interpretation can’t directly lead to improvement action
  • 37. Depth of Inheritance Tree (DIT) is the (maximum) depth level of a class in a class hierarchy. Chidamber, Kemerer, 1994  inheritance is measured  only the potential and not the real impact is quantified
  • 38. Coupling between objects (CBO) shows the number of classes from which methods or attributes are used. Chidamber, Kemerer, 1994  it takes into account real dependencies not just declared ones  no differentiation of types and/or intensity of coupling
  • 39. Tight Class Cohesion (TCC) counts the relative number of method-pairs that access attributes of the class in common. Bieman, Kang, 1995 TCC = 2 / 10 = 0.2  interpretation can lead to improvement action  ratio values allow comparison between systems
  • 40. ...
  • 42. Metrics Assess and Improve Quality!
  • 43. Metrics Assess and Improve Quality! a lly ? Re
  • 45. Problem 1: metrics granularity ? capture symptoms, not causes of problems in isolation, they don’t lead to improvement solutions
  • 46. Problem 1: metrics granularity ? capture symptoms, not causes of problems in isolation, they don’t lead to improvement solutions Problem 2: implicit mapping we don’t reason in terms of metrics, but in terms of design principles
  • 47. 2 big obstacles in using metrics: Thresholds make metrics hard to interpret Granularity make metrics hard to use in isolation
  • 48. Can metrics help me in what I really care for? :)
  • 49. fo rw ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 50. fo rw How do I understand code? ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 51. fo rw How do I understand code? ar d How do I improve code? en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 52. fo rw How do I understand code? ar d How do I improve code? en gin How do I improve myself? ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 53. etr ics! w ith m o do i ng t tn oth I wan fo rw How do I understand code? ar d How do I improve code? en gin How do I improve myself? ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 54. How to get an initial understanding of a system?
  • 55. Metric Value LOC 35175 NOM 3618 NOC 384 CYCLO 5579 NOP 19 CALLS 15128 FANOUT 8590 AHH 0.12 ANDC 0.31
  • 56. Metric Value LOC 35175 NOM 3618 NOC 384 CYCLO 5579 NOP 19 CALLS 15128 FANOUT 8590 AHH 0.12 ANDC 0.31
  • 57. Metric Value LOC 35175 NOM 3618 NOC 384 CYCLO 5579 NOP 19 CALLS 15128 FANOUT 8590 ha t? ww AHH An d no 0.12 ANDC 0.31
  • 58. We need means to compare.
  • 59. hierarchies? coupling?
  • 60. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 Inheritance ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT Size Communication
  • 61. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT Size
  • 62. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT Communication
  • 63. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 Inheritance ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT
  • 64. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT
  • 65. Java C++ LOW AVG HIGH LOW AVG HIGH CYCLO/LOC 0.16 0.20 0.24 0.20 0.25 0.30 LOC/NOM 7 10 13 5 10 16 NOM/NOC 4 7 10 4 9 15 ...
  • 66. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT close to high close to average close to low
  • 67. The Overview Pyramid provides a metrics overview. Lanza, Marinescu 2006 close to high close to average close to low
  • 68. fo rw How do I understand code? ar d How do I improve code? en gin How do I improve myself? ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 69. etr ics! w ith m o do i ng t oth nt n I wa fo rw How do I understand code? ar d How do I improve code? en gin How do I improve myself? ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 70. How do I improve code?
  • 71. Quality is more than 0 bugs. Breaking design principles, rules and best practices deteriorates the code; it leads to design problems.
  • 72. Imagine changing just a small design fragment
  • 73. Imagine changing just a small design fragment
  • 74. Imagine changing just a small design fragment and33% of all classes would require changes
  • 76. expensive Design problems are frequent unavoidable th em? ate limin nd e ete ct a to d How
  • 77. God Classes tend to centralize the intelligence of the system, to do everything and to use data from small data-classes. Riel, 1996
  • 78. God Classes tend to centralize the intelligence of the system, to do everything and to use data from small data-classes.
  • 79. God Classes centralize the intelligence of the system, do everything and use data from small data-classes.
  • 80. God Classes are complex, are not cohesive, access external data.
  • 81. God Classes are complex, are not cohesive, access external data. sing uer ies u to q s s in ator etric per se m ical o Co mpo log
  • 82. Detection Strategies are metric-based queries to detect design flaws. Lanza, Marinescu 2006 Rule 1 METRIC 1 > Threshold 1 AND Quality problem Rule 2 METRIC 2 < Threshold 2
  • 83. 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 Lanza, Marinescu 2006 Identity Collaboration Classification Disharmonies Disharmonies Disharmonies
  • 84. A God Class centralizes too much intelligence in the system. Lanza, Marinescu 2006 Class uses directly more than a few attributes of other classes ATFD > FEW Functional complexity of the class is very high AND GodClass WMC ! VERY HIGH Class cohesion is low TCC < ONE THIRD
  • 85. An Envious Method is more interested in data from a handful of classes. Lanza, Marinescu 2006 Method uses directly more than a few attributes of other classes ATFD > FEW Method uses far more attributes of other classes than its own AND Feature Envy LAA < ONE THIRD The used quot;foreignquot; attributes belong to very few other classes FDP ! FEW
  • 86. Data Classes are dumb data holders. Lanza, Marinescu 2006 Interface of class reveals data rather than offering services WOC < ONE THIRD AND Data Class Class reveals many attributes and is not complex
  • 87. Data Classes are dumb data holders. Lanza, Marinescu 2006 More than a few public data NOAP + NOAM > FEW AND Complexity of class is not high WMC < HIGH Class reveals many OR attributes and is not Class has many public complex data NOAP + NOAM > MANY AND Complexity of class is not very high WMC < VERY HIGH
  • 88. fo rw ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 89. fo rw How do I understand code? ar d How do I improve code? en gin How do I improve myself? ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 90. How do I improve myself?
  • 91. Follow a clear and repeatable process
  • 92. Follow a clear and repeatable process
  • 93. Follow a clear and repeatable process
  • 94. Follow a clear and repeatable process mb ers! so f nu in term qu ality ab out re ason D on’t
  • 95. QA is part of the the Development Process http://loose.upt.ro/incode
  • 96. Can we understand the beauty of a painting by measuring its frame or counting its colors?
  • 97. 1 Software in 2 Software in numbers pictures 3 Software in 4 Software in time tools
  • 104. Numbers.. ANDC 0.31 AHH 0.12 20.21 NOP 19 9.42 NOC 384 9.72 NOM 3618 NOM 418 0.15 LOC 35175 15128 CALLS 0.56 CYCLO 5579 8590 FANOUT
  • 105. Visualization compresses the system into pictures.
  • 106. A picture is worth a thousand words... anonymous ...depends on the picture Lanza
  • 107.
  • 108. U ML han mo re t tio n is liza isua wa re v Soft
  • 109. We are visual beings ... ... and we’re good at spotting patterns
  • 110. How many groups do you see?
  • 111. How many groups do you see?
  • 112. How many groups do you see?
  • 113. How many groups do you see?
  • 114. Gestalt principles proximity similarity enclosure connectivity
  • 116. We do not see with our eyes, but with our brain. Our brain works like a computer, with 3 types of memory Iconic memory, the visual sensory register Short-term memory, the working memory Long-term memory Sensation Perception (Physical Process) (Cognitive Process) Stimulus Sensory Organ Perceptual Organ Brain Iconic Memory - Short-term Memory - Long-term Memory
  • 117. Iconic Short-term memory memory
  • 118. Iconic Short-term memory memory < 1 second very fast automatic subconscious preattentive
  • 119. Iconic Short-term memory memory < 1 second couple of seconds very fast 3-9 chunks automatic subconscious preattentive
  • 120. Categorizing Preattentive Attributes Category Form Color Spatial Motion Motion Orientation Hue 2D position Flicker Line length Intensity Direction Line width Size Attribute Shape Curvature Added marks Enclosure
  • 121. Attributes of Form Orientation Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 122. Attributes of Form Line Length Line Width Size Shape Curvature Added Marks Enclosure
  • 123. Attributes of Form Line Width Size Shape Curvature Added Marks Enclosure
  • 124. Attributes of Form Size Shape Curvature Added Marks Enclosure
  • 125. Attributes of Form Shape Curvature Added Marks Enclosure
  • 126. Attributes of Form Curvature Added Marks Enclosure
  • 127. Attributes of Form Added Marks Enclosure
  • 128. Attributes of Form Enclosure
  • 133. 70% of all external inputs come through the eyes
  • 134. Software visualization is 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. Price, Becker, Small
  • 137.
  • 138. llet r bu no silve
  • 141. A picture is worth a thousand words.
  • 142.
  • 143. era lly :) ok it lit L to UM
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150. Polymetric Views show up to 5 metrics. Lanza, 2003 Width metric Height metric Position metrics Color metric
  • 151. A simple & powerful concept LOC NOS parameters parameters lines
  • 152. System Complexity shows class hierarchies. Lanza, Ducasse, 2003 attributes methods lines
  • 153. Class Blueprint shows class internals. Lanza, Ducasse, 2005 Initialize Interface Internal Accessor Attribute invocation and access direction
  • 154. Class Blueprint has a rich vocabulary. internal access Access external Attribute access Invocation Regular Constant invocations Overriding Delegating lines Method Extending Setter Abstract Getter
  • 155. Class Blueprint reveals patterns. twin classes schizophrenic class
  • 156. Distribution Map shows properties over structure. Ducasse etal, 2006 31 parts, 394 elements and 9 properties
  • 157. Softwarenaut explores the package structure. Lungu etal, 2006
  • 158. Code City shows where your code lives. Wettel, Lanza, 2007 classes are buildings grouped in quarters of packages
  • 159. Jmol - The Time Machine
  • 160. Jmol - The Time Machine
  • 161. Jmol - The Time Machine
  • 162. Jmol - The Time Machine
  • 163. Jmol - The Time Machine
  • 164. Jmol - The Time Machine
  • 165. Jmol - The Time Machine
  • 166. Jmol - The Time Machine
  • 168. 1 Software in 2 Software in numbers pictures 3 Software in 4 Software in time tools
  • 170. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
  • 171. { { } } } { { { } } re v er se en gin ee rin g reverse engineering fo actual development rw ar d en gin ee rin g { { } } { { } }
  • 172. { { { { } } } } { } A large system contains lots of details.
  • 173. { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } { } } { } } { } } { } } { } The history of a large system contains even more details.
  • 174. Most often time is put on the horizontal and a property on the vertical axis. Lehman etal, 2001
  • 175. Spectographs show change activity. Wu etal, 2004 commit time
  • 176. Evolution Matrix shows changes in classes. Lanza, Ducasse, 2002 Idle class Pulsar class Supernova class White dwarf class
  • 177. Evolution Matrix shows changes in classes. Lanza, Ducasse, 2002
  • 178. History can be measured.
  • 179. What changed? When did it change? ... 2 4 3 5 7 2 2 3 4 9 2 2 1 2 3 2 2 2 2 2 1 5 3 4 4
  • 180. Evolution of Number of Methods LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n LENOM(C) = 4 + 2 + 1 + 0 = 7 1 5 3 4 4
  • 181. Latest Evolution of Number of Methods LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n Earliest Evolution of Number of Methods EENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 22-i -3 -2 -1 0 LENOM(C) = 42 + 22 + 12 + 02 = 1.5 1 5 3 4 4 EENOM(C) = 4 20 + 2 2-1 + 1 2-2 + 0 2-3 = 5.25
  • 182. ENOM LENOM EENOM 2 4 3 5 7 7 3.5 3.25 2 2 3 4 9 7 5.75 1.37 2 2 1 2 3 3 1 2 2 2 2 2 2 0 0 0 1 5 3 4 4 7 1.25 5.25
  • 183. ENOM LENOM EENOM balanced changer 7 3.5 3.25 late changer 7 5.75 1.37 3 1 2 dead stable 0 0 0 early changer 7 1.25 5.25
  • 184. ENOM LENOM EENOM balanced changer 7 3.5 3.25 late changer 7 5.75 1.37 ed. measur3 1 2 be ry can H isto dead stable 0 0 0 early changer 7 1.25 5.25
  • 185. History can be measured in many ways. Evolution Number of Methods Stability Number of Lines of Code Historical Max of Cyclomatic Complexity Growth Trend Number of Modules ... ...
  • 186. The recently changed parts are likely to change in the near future. Common wisdom
  • 187. The recently changed parts are likely to change in the near future. ally? Common wisdom re re they A
  • 188. 30% 90%
  • 189.
  • 191. past present
  • 192. past future present
  • 193. past future present
  • 194. past future present
  • 195. past future YesterdayWeatherHit(present): past:=histories.topLENOM(start, present) future:=histories.topEENOM(present, end) past.intersectWith(future).notEmpty() present
  • 196. past future YesterdayWeatherHit(present): past:=histories.topLENOM(start, present) future:=histories.topEENOM(present, end) past.intersectWith(future).notEmpty() present prediction hit
  • 197. Yesterday’s Weather shows the localization of changed in time. Girba etal, 2004 hit hit hit YW = 3 / 8 = 37% hit hit hit hit hit hit hit YW = 7 / 8 = 87%
  • 198. A God Class centralizes too much intelligence in the system. Class uses directly more than a few attributes of other classes ATFD > FEW Functional complexity of the class is very high AND GodClass WMC ! VERY HIGH Class cohesion is low TCC < ONE THIRD
  • 199. A God Class centralizes too much intelligence in the system. Class uses directly more than a few attributes of other classes ATFD > FEW tab le? f it is s wh Functional complexity of the at i ut, class is very high B AND GodClass WMC ! VERY HIGH Class cohesion is low TCC < ONE THIRD
  • 200. History-based Detection Strategies take evolution into account. Ratiu etal, 2004 God Class in the last version isGodClass(last) AND Harmless God Class Stable throughout the history Stability > 90%
  • 201. What happens with inheritance? A A A A A B C B C B C B B D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A is persistent, B is stable, C was removed, E is newborn ...
  • 202. Hierarchy Evolution encapsulates time. Girba etal, 2005 A changed methods changed age lines C B Removed Removed D E A is persistent, B is stable, C was removed, E is newborn ...
  • 203. Hierarchy Evolution reveals patterns. Girba etal, 2005
  • 204. Co-change analysis recovers hidden dependencies. Time is the lines. Gall etal, 2003
  • 205. Evolution Radar shows co-change relationships. D’Ambros, Lanza 2006 one package and its co-change relationships
  • 206. Software is developed by people.
  • 208. Who is responsible for this?
  • 209. Who is responsible for this?
  • 211. Ownership Map reveals development patterns. Girba etal, 2006
  • 212. JEdit
  • 213. Ant
  • 214. Who copied from whom? (john 23.06.03) public boolean stillValid (ToDoItem I, Designer dsgr) { (bill 09.01.05) if (!isActive()) { (bill 09.01.05) return false (bill 09.01.05) } (steve 16.02.05) List offs = i.getOffenders(); (john 23.06.03) Object dm = offs.firstElement(); (steve 16.02.05) ListSet newOffs = computeOffenders(dm); (john 23.06.03) boolean res = offs.equals(newOffs); (john 23.06.03) return res; (george 13.02.05) public boolean stillValid (ToDoItem I, Designer dsgr) { (bill 11.13.05) if (!isActive()) { (bill 11.13.05) return false (bill 11.13.05) } (steve 16.02.05) List offs = i.getOffenders(); (george 13.02.05) Object dm = offs.firstElement(); (steve 16.02.05) ListSet newOffs = computeOffenders(dm); (george 13.02.05) boolean res = offs.equals(newOffs); (george 13.02.05) return res;
  • 215. What is useless? (john 23.06.03) public boolean stillValid (ToDoItem I, Designer dsgr) { (bill 09.01.05) if (!isActive()) { (bill 09.01.05) return false (bill 09.01.05) } (steve 16.02.05) List offs = i.getOffenders(); (john 23.06.03) Object dm = offs.firstElement(); (steve 16.02.05) ListSet newOffs = computeOffenders(dm); (john 23.06.03) boolean res = offs.equals(newOffs); (john 23.06.03) return res; (george 13.02.05) public boolean stillValid (ToDoItem I, Designer dsgr) { (bill 11.13.05) if (!isActive()) { (bill 11.13.05) return false (bill 11.13.05) } (steve 16.02.05) List offs = i.getOffenders(); (george 13.02.05) Object dm = offs.firstElement(); (steve 16.02.05) ListSet newOffs = computeOffenders(dm); (george 13.02.05) boolean res = offs.equals(newOffs); (george 13.02.05) return res;
  • 216. When did changes happen? 23.06.03 public boolean stillValid (ToDoItem I, Designer dsgr) { 09.01.05 if (!isActive()) { 09.01.05 return false 09.01.05 } 16.02.05 List offs = i.getOffenders(); 23.06.03 Object dm = offs.firstElement(); 16.02.05 ListSet newOffs = computeOffenders(dm); 23.06.03 boolean res = offs.equals(newOffs); 23.06.03 return res; 13.02.05 public boolean stillValid (ToDoItem I, Designer dsgr) { 11.13.05 if (!isActive()) { 11.13.05 return false 11.13.05 } 16.02.05 List offs = i.getOffenders(); 13.02.05 Object dm = offs.firstElement(); 16.02.05 ListSet newOffs = computeOffenders(dm); 13.02.05 boolean res = offs.equals(newOffs); 13.02.05 return res;
  • 217. Clone Evolution shows how developers copy. Balint etal, 2006
  • 218. { { } } } { { { } } re v er se en gin ee rin g reverse engineering fo actual development rw ar d en gin ee rin g { { } } { { } }
  • 219. 1 Software in 2 Software in numbers pictures 3 Software in 4 Software in time tools
  • 221. http://moose.unibe.ch http://loose.upt.ro/incode http://www.inf.unisi.ch/phd/wettel/codecity.html
  • 222. Pragmatic Design Quality Assessment Tudor Gîrba University of Bern, Switzerland Michele Lanza University of Lugano, Switzerland Radu Marinescu Politehnica University of Timisoara, Romania
  • 223. Tudor Gîrba, Michele Lanza, Radu Marinescu http://creativecommons.org/licenses/by/3.0/