SlideShare una empresa de Scribd logo
1 de 68
Descargar para leer sin conexión
Reverse engineering
    techniques



      Tudor Gîrba
    www.tudorgirba.com
fo
                                            rw
                                              ar
                                                d
                                                 en
                                                     gin
                                                      ee
                                                       rin
                                                           g
{               {
    {                   {                                      {               {
                            }                                      {               {
        }
        }                       actual development                     }               }
            }       {       }                                              }               }
fo
                                                              rw
                                              g
                                            rin




                                                                ar
                                         ee




                                                                  d
                                        gin




                                                                   en
                                                                       gin
                                       en




                                                                        ee
                                   se




                                                                         rin
                                 erv




                                                                             g
                                re




{               {
    {                   {                                                        {               {
                            }                                                        {               {
        }
        }                                         actual development                     }               }
            }       {       }                                                                }               }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries                                   Visualizations   ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries                                   Visualizations   ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


Metrics                          Queries                                   Visualizations   ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
What are software metrics?
Youcannot control
what you cannot measure.




                           Tom de Marco
Software metrics are measurements which
relate to software systems, processes or
related documents
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



                                Lorentz, Kidd, 1994
                                  Chidamber, 1994
McCabe cyclomatic complexity counts
the number of possible paths through the code of a
function.




                                           McCabe, 1977
Metrics compress the system into numbers
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


Metrics                          Queries                                   Visualizations   ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries                               Visualizations   ...


                                       {               {
                                           {                   {
                                                                   }
                                               }
                                               }
                                                   }       {       }
Queries reduce the analysis space
Detection Strategies are metric-based queries to
detect design flaws
    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
Flaw: 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
Flaw: a Data Class provides data to other classes,
but little or no functionality of its own
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries                               Visualizations   ...


                                       {               {
                                           {                   {
                                                                   }
                                               }
                                               }
                                                   }       {       }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries               Visualizations      ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
Visualization compresses the system into pictures
1854, London cholera epidemic
a picture is worth

a   thousand words
UML took it literally :)
We
are

visual
beings
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
are

visual
beings
a picture is worth

a   thousand words
example: what is   ?
Polymetric views show up to 5 metrics
                                            Lanza, 2003

                        Width metric

        Height metric



  Position metrics

                                   Color
                                   metric
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 shows class internals
Distribution Map shows properties
                                    Ducasse etal, 2006
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
                                                                  rw
                                                             ar
    actual development
                                                         d
                                                    en
                                              gin
                                         ee
                                   rin
                               g
                         {
             {
    }
}
                         {
             {
    }
}
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
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
History contains too much data


  A                A                A                A                A            A                A                A                A                A            A                A                A                A                A            A                A                A                A                A




         B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B




                              D                D                D            E                                 D                D                D            E                                 D                D                D            E                                 D                D                D            E


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


  A                A                A                A                A            A                A                A                A                A            A                A                A                A                A            A                A                A                A                A




         B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B




                              D                D                D            E                                 D                D                D            E                                 D                D                D            E                                 D                D                D            E


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


  A                A                A                A                A            A                A                A                A                A            A                A                A                A                A            A                A                A                A                A




         B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B




                              D                D                D            E                                 D                D                D            E                                 D                D                D            E                                 D                D                D            E


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

  A                A                A                A                A            A                A                A                A                A            A                A                A                A                A            A                A                A                A                A




         B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B            B   C            B   C            B   C            B                B




                              D                D                D            E                                 D                D                D            E                                 D                D                D            E                                 D                D                D            E


ver .1           ver. 2           ver. 3           ver. 4           ver. 5       ver .1           ver. 2           ver. 3           ver. 4           ver. 5       ver .1           ver. 2           ver. 3           ver. 4           ver. 5       ver .1           ver. 2           ver. 3           ver. 4           ver. 5
History contains too much data

   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 View reveals patterns
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries               Visualizations      ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
But, what actually happens
behind the scene?
Example: CVS shows activity
Who did this?
Alphabetical order is no order
                                 Kuhn
Ownership Map orders histories
                                 Girba etal, 2006
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C
         LO


  Metrics                        Queries               Visualizations      ...


                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
McCabe = 21

NOM                          0
      = 102
                        3 ,00
                      75
                  =
              C



                                                                                            ...
         LO


  Metrics                        Queries                                   Visualizations




                                           {               {
                                               {                   {
                                                                       }
                                                   }
                                                   }
                                                       }       {       }
Tudor Gîrba
       www.tudorgirba.com




creativecommons.org/licenses/by/3.0/

Más contenido relacionado

Destacado

Reverse engineering & its application
Reverse engineering & its applicationReverse engineering & its application
Reverse engineering & its application
mapqrs
 
Reverse Engineering Object-Oriented Distributed Systems
Reverse Engineering Object-Oriented Distributed SystemsReverse Engineering Object-Oriented Distributed Systems
Reverse Engineering Object-Oriented Distributed Systems
ICSM 2010
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
Sameer Sapra
 
ravi reverseengineeringitsapplication01 121101044845-phpapp02
ravi reverseengineeringitsapplication01 121101044845-phpapp02ravi reverseengineeringitsapplication01 121101044845-phpapp02
ravi reverseengineeringitsapplication01 121101044845-phpapp02
Akash Maurya
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse Engineering
Dobromir Enchev
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
Yuffie Valen
 
Software Reengineering
Software ReengineeringSoftware Reengineering
Software Reengineering
Abdul Wahid
 
Reengineering including reverse & forward Engineering
Reengineering including reverse & forward EngineeringReengineering including reverse & forward Engineering
Reengineering including reverse & forward Engineering
Muhammad Chaudhry
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)
varun teja G.V.V
 

Destacado (20)

Reverse engineering & its application
Reverse engineering & its applicationReverse engineering & its application
Reverse engineering & its application
 
Reverse Engineering Object-Oriented Distributed Systems
Reverse Engineering Object-Oriented Distributed SystemsReverse Engineering Object-Oriented Distributed Systems
Reverse Engineering Object-Oriented Distributed Systems
 
Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)
 
Introduction of Reverse Engineering
Introduction of Reverse EngineeringIntroduction of Reverse Engineering
Introduction of Reverse Engineering
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
 
Maintenance, Re-engineering &Reverse Engineering in Software Engineering
Maintenance,Re-engineering &Reverse Engineering in Software EngineeringMaintenance,Re-engineering &Reverse Engineering in Software Engineering
Maintenance, Re-engineering &Reverse Engineering in Software Engineering
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
data acquisition methods in reverse engineering
data acquisition methods in reverse engineeringdata acquisition methods in reverse engineering
data acquisition methods in reverse engineering
 
ravi reverseengineeringitsapplication01 121101044845-phpapp02
ravi reverseengineeringitsapplication01 121101044845-phpapp02ravi reverseengineeringitsapplication01 121101044845-phpapp02
ravi reverseengineeringitsapplication01 121101044845-phpapp02
 
Reversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detectionReversing Engineering a Web Application - For fun, behavior and detection
Reversing Engineering a Web Application - For fun, behavior and detection
 
Reverse Engineering Web Applications
Reverse Engineering Web ApplicationsReverse Engineering Web Applications
Reverse Engineering Web Applications
 
WARE: a tool for the Reverse Engineering of Web Applications
WARE: a tool for the Reverse Engineering of Web Applications WARE: a tool for the Reverse Engineering of Web Applications
WARE: a tool for the Reverse Engineering of Web Applications
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse Engineering
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
 
Software Reengineering
Software ReengineeringSoftware Reengineering
Software Reengineering
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
 
Reengineering including reverse & forward Engineering
Reengineering including reverse & forward EngineeringReengineering including reverse & forward Engineering
Reengineering including reverse & forward Engineering
 
Pergub no 1 th 2016 pedoman rt-rw konsolidasi
Pergub no 1 th 2016 pedoman rt-rw konsolidasiPergub no 1 th 2016 pedoman rt-rw konsolidasi
Pergub no 1 th 2016 pedoman rt-rw konsolidasi
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)
 
Ch15 software reuse
Ch15 software reuseCh15 software reuse
Ch15 software reuse
 

Similar a Reverse Engineering Techniques 2007-11-29

A Moose Slideshow
A Moose SlideshowA Moose Slideshow
A Moose Slideshow
Tudor Girba
 
Helping you reengineering your legacy
Helping you reengineering your legacyHelping you reengineering your legacy
Helping you reengineering your legacy
Stéphane Ducasse
 
05 Problem Detection
05 Problem Detection05 Problem Detection
05 Problem Detection
Jorge Ressia
 

Similar a Reverse Engineering Techniques 2007-11-29 (17)

Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)
Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)
Pragmatic Design Quality Assessment - (Tutorial at ICSE 2008)
 
Moose Overview
Moose OverviewMoose Overview
Moose Overview
 
A Moose Slideshow
A Moose SlideshowA Moose Slideshow
A Moose Slideshow
 
Problem Detection (EVO 2008)
Problem Detection (EVO 2008)Problem Detection (EVO 2008)
Problem Detection (EVO 2008)
 
Humane assessment at ICSM 2010
Humane assessment at ICSM 2010Humane assessment at ICSM 2010
Humane assessment at ICSM 2010
 
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
 
What history can tell us
What history can tell usWhat history can tell us
What history can tell us
 
Helping you reengineering your legacy
Helping you reengineering your legacyHelping you reengineering your legacy
Helping you reengineering your legacy
 
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
 
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
 
Modeling History to Understand Software Evolution With Hismo 2008-02-25
Modeling History to Understand Software Evolution With Hismo 2008-02-25 Modeling History to Understand Software Evolution With Hismo 2008-02-25
Modeling History to Understand Software Evolution With Hismo 2008-02-25
 
History Analysis (EVO 2008)
History Analysis (EVO 2008)History Analysis (EVO 2008)
History Analysis (EVO 2008)
 
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)
 
Moose Tutorial at WCRE 2008
Moose Tutorial at WCRE 2008Moose Tutorial at WCRE 2008
Moose Tutorial at WCRE 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
 

Más de Tudor Girba

Más 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
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Reverse Engineering Techniques 2007-11-29

  • 1. Reverse engineering techniques Tudor Gîrba www.tudorgirba.com
  • 2. fo rw ar d en gin ee rin g { { { { { { } { { } } actual development } } } { } } }
  • 3. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
  • 4. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 5. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 6. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 8. Youcannot control what you cannot measure. Tom de Marco
  • 9. Software metrics are measurements which relate to software systems, processes or related documents
  • 10. 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 Lorentz, Kidd, 1994 Chidamber, 1994
  • 11. McCabe cyclomatic complexity counts the number of possible paths through the code of a function. McCabe, 1977
  • 12. Metrics compress the system into numbers
  • 13. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 14. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 15. Queries reduce the analysis space
  • 16.
  • 17. Detection Strategies are metric-based queries to detect design flaws 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
  • 18. Flaw: 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
  • 19. Flaw: a Data Class provides data to other classes, but little or no functionality of its own
  • 20. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 21. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 22. Visualization compresses the system into pictures
  • 24. a picture is worth a thousand words
  • 25.
  • 26. UML took it literally :)
  • 28. How many groups do you see?
  • 29. How many groups do you see?
  • 30. How many groups do you see?
  • 31. How many groups do you see?
  • 32. Gestalt principles proximity similarity enclosure connectivity
  • 35. a picture is worth a thousand words
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Polymetric views show up to 5 metrics Lanza, 2003 Width metric Height metric Position metrics Color metric
  • 43. System Complexity shows class hierarchies Lanza, Ducasse, 2003 attributes methods lines
  • 44. Class Blueprint shows class internals Lanza, Ducasse, 2005 Initialize Interface Internal Accessor Attribute invocation and access direction
  • 45. Class Blueprint has a rich vocabulary internal access Access external Attribute access Invocation Regular Constant invocations Overriding Delegating lines Method Extending Setter Abstract Getter
  • 46. Class Blueprint shows class internals
  • 47. Distribution Map shows properties Ducasse etal, 2006
  • 48. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
  • 49. { { } } } { { { } } re v er se en gin ee rin g reverse engineering fo rw ar actual development d en gin ee rin g { { } } { { } }
  • 50. Spectographs show change activity Wu etal, 2004 commit time
  • 51. Evolution Matrix shows changes in classes Lanza, Ducasse, 2002 Idle class Pulsar class Supernova class White dwarf class
  • 52. Evolution Matrix shows changes in classes
  • 53. 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
  • 54. History contains too much data A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5
  • 55. History contains too much data 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 ...
  • 56. 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 ...
  • 57. Hierarchy Evolution View reveals patterns
  • 58. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 59. But, what actually happens behind the scene?
  • 62. Alphabetical order is no order Kuhn
  • 63. Ownership Map orders histories Girba etal, 2006
  • 64.
  • 65. McCabe = 21 NOM 0 = 102 3 ,00 75 = C LO Metrics Queries Visualizations ... { { { { } } } } { }
  • 66. McCabe = 21 NOM 0 = 102 3 ,00 75 = C ... LO Metrics Queries Visualizations { { { { } } } } { }
  • 67.
  • 68. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/