SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Structure of the lecture


                                                                                                                       91 I 112

                                                              Analysis

                            Static                                                                         Dynamic
                           Analysis                                                                        Analysis




metrics                  patterns                          models                                       testing



       Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
92 I 112




                       REVERSE ENGINEERING




Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Terminology



                                                                                                                       93 I 112


                                          Models / Specifications
                                           UML, ER, VDM, …

                                                                                    Re-engineering

abstract
concrete

       Reverse
     engineering
                                                   Programs
                                               Java, SQL, Perl, …


       Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Reverse engineering



Dependencies and graphs                                                                                                 94 I 112

 • Extraction, manipulation, presentation
 • Graph metrics
 • Slicing

Advanced
 • Type reconstruction
 • Concept analysis
 • Programmatic join extraction




        Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Reverse engineering trinity



                                                                                                                      95 I 112

  Extraction

      From program sources, extract basic information into an initial
      source model.

  Manipulation

      Combine, condense, aggregate, or otherwise process the basic
      information to obtain a derived source model.

  Presentation

      Visualize or otherwise present source models to a user.


      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Example



                                                                                                                    96 I 112




                                                                   Green oval = module
                                                                   Blue oval = table


                                                                   Purple arrow = select operation
                                                                   Yellow arrow = insert/update operation
                                                                   Brown arrow = delete operation




    Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Example



                                                                                                                      97 I 112




  Tables used by multiple modules.                              Tables used by a single module.


      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Relations and graphs



                                                                                                                      98 I 112

  Relation

     type Rel a b = Set (a,b)                                                 set of pairs

  Graph

     type Gph a = Rel a a                                                     endo-relation

  Labeled relation
     type LRel a b l = Map (a,b) l                                                      map from pairs

  Note
     Rel a b = Set(a,b)= Map(a,b)()= LRel a b ()

      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Slicing (forward)



                                                                                                                      99 I 112




      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Slicing (backward)



                                                                                                                      100 I 112




      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Chop
= Forward ∩ Backward


                                                                                                                     101 I 112




     Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Generic slicing



                                                                                                                       102 I 112


                                              Graph                                                   slice
                                          (control flow,                                          (interactive)
                                            data flow,
                                          structure, …)

abstract
concrete
                              extract

                      Java                                                                            new program
                    program                                                transform                  / spreadsheet
                                      Excel
                                   spreadsheet                                                        / architecture
                                                             System
                                                           architecture
       Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Further reading



                                                                                                                        103 I 112




  See
  Arun Lakhotia.
  Graph theoretic foundations of program slicing and integration.
  The Center for Advanced Computer Studies, University of Southwestern Louisiana.
  Technical Report CACS TR-91-5-5, 1991.




        Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Type reconstruction
(from type-less legacy code)


                                                                                                                        104 I 112

  See
  •     Arie van Deursen and Leon Moonen. An empirical Study Into Cobol Type
        Inferencing. Science of Computer Programming 40(2-3):189-211, July 2001

  Basic idea
  1. Extract basic relations (entities are variables)
     - assign:            ex. a := b
     - expression:        ex. a <= b
     - arrayIndex:         ex. A[i ]
  2. Compute derived relations
     - typeEquiv: variables belong to the same type
     - subtypeOf: variables belong to super/subtype
     - extensional notion of type: set of variables

        Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Type reconstruction
(from type-less legacy code)


                                                                                                                      105 I 112


  Pseudo code from paper




      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Type reconstruction
(from type-less legacy code)


                                                                                                                      106 I 112

  Data
  type VariableGraph v array
    = (Rel v v, Rel v array, Rel v v)

  type TypeGraph x
    = (Rel x x, Rel x x)                                  -- subtypes and type equiv

  Operation
  typeInference
    :: (Ord v, Ord array) =>
       VariableGraph v array -> TypeGraph v




      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Formal concept analysis



                                                                                                                        107 I 112

  See
  •     Christian Lindig. Fast Concept Analysis. In Gerhard Stumme, editors, Working
        with Conceptual Structures - Contributions to ICCS 2000, Shaker Verlag,
        Aachen, Germany, 2000.

  Basic idea
  1. Given formal context
      - matrix of objects vs. properties
  2. Compute concept lattice
      - a concept = (extent,intent)
      - ordering is by sub/super set relation on intent/extent
  Used in many fields, including program understanding.


        Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Formal concept analysis
pseudo-code (1/2)


                                                                                                                      108 I 112




  Note that _’ operation denotes computation of intent from extent, or
     vice versa, implicitly given a context.
      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Formal concept analysis
pseudo-code (2/2)


                                                                                                                      109 I 112




  Transposition to Haskell?
      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Formal concept analysis



                                                                                                                      110 I 112
  Representation
     type       Context g m = Rel g m
     type       Concept g m = (Set g, Set m)
     type       ConceptLattice g m
        =       Rel (Concept g m) (Concept g m)

  Algorithm
  neighbors ::             (Ord g, Ord m)
            =>             Set g                                   -- extent of concept
            ->             Context g m                             -- formal context
            ->             [Concept g m]                           -- list of neighbors

  lattice :: (Ord g, Ord m)
          => Context g m                                           -- formal context
          -> ConceptLattice g m                                    -- concept lattice

      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Ongoing projects at SIG



Repository mining                                                                                                        111 I 112

 • Analyze relationships between code/commits/issues through time
 • Clustering and decision trees
 • Popularity index for programming languages, frameworks, …

Quality and metrics
 • Generalized method for derivation of quality profiles
 • Metrics for architectural quality and evolution
 • Quality models for BPEL, SAP, Sharepoint, …

Large-scale source code analysis
 • Detection of “events” in data streams
 • Using the Amazon cloud
 • Metrics warehouse
         Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
Possible MFES projects at SIG



Massively parallel source code analysis                                                                                112 I 112

 • Use Hadoop framework for Map-Reduce
 • Put algebraic API on top
 • Construct example analyses

Java library binary relational algebra
 • Extend to “labeled” relations (matrix algebra)
 • Extend with advanced algorithms (e.g. concept analysis)

Randomized testing for Java
 • Study existing approaches
 • Build / extend tool

       Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
More info? Feel free to contact…


                                                                                                                      113 I 112




                                           Dr. ir. Joost Visser
                                           E:       j.visser@sig.nl
                                           W:       www.sig.nl
                                           T:       +31 20 3140950




      Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.

Contenu connexe

Similaire à 2010 01 lecture SIG UM MFES 3 - Reverse engineering

2010 01 lecture SIG UM MFES 1 - Intro and testing
2010 01 lecture SIG UM MFES 1 - Intro and testing2010 01 lecture SIG UM MFES 1 - Intro and testing
2010 01 lecture SIG UM MFES 1 - Intro and testingjstvssr
 
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics qualityjstvssr
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology
 
Analyze your software assets with Modisco par Frédéric Madiot
Analyze your software assets with Modisco par Frédéric MadiotAnalyze your software assets with Modisco par Frédéric Madiot
Analyze your software assets with Modisco par Frédéric MadiotEclipseDayParis
 
Concurrent systems composing
Concurrent systems composingConcurrent systems composing
Concurrent systems composingEric Verhulst
 
Heizer om10 ch07-process startegy
Heizer om10 ch07-process startegyHeizer om10 ch07-process startegy
Heizer om10 ch07-process startegyRozaimi Mohd Saad
 
Application deployment automation (XebiaLabs)
Application deployment automation (XebiaLabs)Application deployment automation (XebiaLabs)
Application deployment automation (XebiaLabs)XebiaLabs
 
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von Aspediens
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von AspediensServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von Aspediens
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von AspediensRené Haeberlin
 
Webinar on deployment automation Xebialabs - 15 sept 2010
Webinar on deployment automation  Xebialabs - 15 sept 2010Webinar on deployment automation  Xebialabs - 15 sept 2010
Webinar on deployment automation Xebialabs - 15 sept 2010XebiaLabs
 
Software Architecture: views and viewpoints
Software Architecture: views and viewpointsSoftware Architecture: views and viewpoints
Software Architecture: views and viewpointsHenry Muccini
 
Dan Webster Resume
Dan Webster ResumeDan Webster Resume
Dan Webster Resumedan_webster
 
Dan Webster Resume Current
Dan Webster Resume CurrentDan Webster Resume Current
Dan Webster Resume Currentdan_webster
 
Deployit overview for JUG-Italy meeting
Deployit overview for JUG-Italy meetingDeployit overview for JUG-Italy meeting
Deployit overview for JUG-Italy meetingXebiaLabs
 
Reliability doe the proper analysis approach for life data
Reliability doe the proper analysis approach for life dataReliability doe the proper analysis approach for life data
Reliability doe the proper analysis approach for life dataASQ Reliability Division
 
AF3 Interner Tag Offene Tueren
AF3 Interner Tag Offene TuerenAF3 Interner Tag Offene Tueren
AF3 Interner Tag Offene Tuerenaf_devel
 
Application Performance Monitoring with boom
Application Performance Monitoring with boomApplication Performance Monitoring with boom
Application Performance Monitoring with boomnetage-solutions
 
Experimental Study Using Functional Size Measurement in Building Estimation M...
Experimental Study Using Functional Size Measurement in Building Estimation M...Experimental Study Using Functional Size Measurement in Building Estimation M...
Experimental Study Using Functional Size Measurement in Building Estimation M...Luigi Buglione
 

Similaire à 2010 01 lecture SIG UM MFES 3 - Reverse engineering (20)

2010 01 lecture SIG UM MFES 1 - Intro and testing
2010 01 lecture SIG UM MFES 1 - Intro and testing2010 01 lecture SIG UM MFES 1 - Intro and testing
2010 01 lecture SIG UM MFES 1 - Intro and testing
 
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software Development
 
Analyze your software assets with Modisco par Frédéric Madiot
Analyze your software assets with Modisco par Frédéric MadiotAnalyze your software assets with Modisco par Frédéric Madiot
Analyze your software assets with Modisco par Frédéric Madiot
 
Concurrent systems composing
Concurrent systems composingConcurrent systems composing
Concurrent systems composing
 
Heizer om10 ch07-process startegy
Heizer om10 ch07-process startegyHeizer om10 ch07-process startegy
Heizer om10 ch07-process startegy
 
Application deployment automation (XebiaLabs)
Application deployment automation (XebiaLabs)Application deployment automation (XebiaLabs)
Application deployment automation (XebiaLabs)
 
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von Aspediens
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von AspediensServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von Aspediens
ServiceNow Event 15.11.2012 / Beispiele aus Kundenprojekten von Aspediens
 
2 Process
2 Process2 Process
2 Process
 
ME2011 presentation by Winter
ME2011 presentation by WinterME2011 presentation by Winter
ME2011 presentation by Winter
 
Webinar on deployment automation Xebialabs - 15 sept 2010
Webinar on deployment automation  Xebialabs - 15 sept 2010Webinar on deployment automation  Xebialabs - 15 sept 2010
Webinar on deployment automation Xebialabs - 15 sept 2010
 
Software Architecture: views and viewpoints
Software Architecture: views and viewpointsSoftware Architecture: views and viewpoints
Software Architecture: views and viewpoints
 
Dan Webster Resume
Dan Webster ResumeDan Webster Resume
Dan Webster Resume
 
L01web 2x2
L01web 2x2L01web 2x2
L01web 2x2
 
Dan Webster Resume Current
Dan Webster Resume CurrentDan Webster Resume Current
Dan Webster Resume Current
 
Deployit overview for JUG-Italy meeting
Deployit overview for JUG-Italy meetingDeployit overview for JUG-Italy meeting
Deployit overview for JUG-Italy meeting
 
Reliability doe the proper analysis approach for life data
Reliability doe the proper analysis approach for life dataReliability doe the proper analysis approach for life data
Reliability doe the proper analysis approach for life data
 
AF3 Interner Tag Offene Tueren
AF3 Interner Tag Offene TuerenAF3 Interner Tag Offene Tueren
AF3 Interner Tag Offene Tueren
 
Application Performance Monitoring with boom
Application Performance Monitoring with boomApplication Performance Monitoring with boom
Application Performance Monitoring with boom
 
Experimental Study Using Functional Size Measurement in Building Estimation M...
Experimental Study Using Functional Size Measurement in Building Estimation M...Experimental Study Using Functional Size Measurement in Building Estimation M...
Experimental Study Using Functional Size Measurement in Building Estimation M...
 

Dernier

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Dernier (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

2010 01 lecture SIG UM MFES 3 - Reverse engineering

  • 1. Structure of the lecture 91 I 112 Analysis Static Dynamic Analysis Analysis metrics patterns models testing Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 2. 92 I 112 REVERSE ENGINEERING Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 3. Terminology 93 I 112 Models / Specifications UML, ER, VDM, … Re-engineering abstract concrete Reverse engineering Programs Java, SQL, Perl, … Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 4. Reverse engineering Dependencies and graphs 94 I 112 • Extraction, manipulation, presentation • Graph metrics • Slicing Advanced • Type reconstruction • Concept analysis • Programmatic join extraction Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 5. Reverse engineering trinity 95 I 112 Extraction From program sources, extract basic information into an initial source model. Manipulation Combine, condense, aggregate, or otherwise process the basic information to obtain a derived source model. Presentation Visualize or otherwise present source models to a user. Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 6. Example 96 I 112 Green oval = module Blue oval = table Purple arrow = select operation Yellow arrow = insert/update operation Brown arrow = delete operation Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 7. Example 97 I 112 Tables used by multiple modules. Tables used by a single module. Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 8. Relations and graphs 98 I 112 Relation type Rel a b = Set (a,b) set of pairs Graph type Gph a = Rel a a endo-relation Labeled relation type LRel a b l = Map (a,b) l map from pairs Note Rel a b = Set(a,b)= Map(a,b)()= LRel a b () Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 9. Slicing (forward) 99 I 112 Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 10. Slicing (backward) 100 I 112 Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 11. Chop = Forward ∩ Backward 101 I 112 Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 12. Generic slicing 102 I 112 Graph slice (control flow, (interactive) data flow, structure, …) abstract concrete extract Java new program program transform / spreadsheet Excel spreadsheet / architecture System architecture Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 13. Further reading 103 I 112 See Arun Lakhotia. Graph theoretic foundations of program slicing and integration. The Center for Advanced Computer Studies, University of Southwestern Louisiana. Technical Report CACS TR-91-5-5, 1991. Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 14. Type reconstruction (from type-less legacy code) 104 I 112 See • Arie van Deursen and Leon Moonen. An empirical Study Into Cobol Type Inferencing. Science of Computer Programming 40(2-3):189-211, July 2001 Basic idea 1. Extract basic relations (entities are variables) - assign: ex. a := b - expression: ex. a <= b - arrayIndex: ex. A[i ] 2. Compute derived relations - typeEquiv: variables belong to the same type - subtypeOf: variables belong to super/subtype - extensional notion of type: set of variables Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 15. Type reconstruction (from type-less legacy code) 105 I 112 Pseudo code from paper Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 16. Type reconstruction (from type-less legacy code) 106 I 112 Data type VariableGraph v array = (Rel v v, Rel v array, Rel v v) type TypeGraph x = (Rel x x, Rel x x) -- subtypes and type equiv Operation typeInference :: (Ord v, Ord array) => VariableGraph v array -> TypeGraph v Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 17. Formal concept analysis 107 I 112 See • Christian Lindig. Fast Concept Analysis. In Gerhard Stumme, editors, Working with Conceptual Structures - Contributions to ICCS 2000, Shaker Verlag, Aachen, Germany, 2000. Basic idea 1. Given formal context - matrix of objects vs. properties 2. Compute concept lattice - a concept = (extent,intent) - ordering is by sub/super set relation on intent/extent Used in many fields, including program understanding. Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 18. Formal concept analysis pseudo-code (1/2) 108 I 112 Note that _’ operation denotes computation of intent from extent, or vice versa, implicitly given a context. Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 19. Formal concept analysis pseudo-code (2/2) 109 I 112 Transposition to Haskell? Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 20. Formal concept analysis 110 I 112 Representation type Context g m = Rel g m type Concept g m = (Set g, Set m) type ConceptLattice g m = Rel (Concept g m) (Concept g m) Algorithm neighbors :: (Ord g, Ord m) => Set g -- extent of concept -> Context g m -- formal context -> [Concept g m] -- list of neighbors lattice :: (Ord g, Ord m) => Context g m -- formal context -> ConceptLattice g m -- concept lattice Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 21. Ongoing projects at SIG Repository mining 111 I 112 • Analyze relationships between code/commits/issues through time • Clustering and decision trees • Popularity index for programming languages, frameworks, … Quality and metrics • Generalized method for derivation of quality profiles • Metrics for architectural quality and evolution • Quality models for BPEL, SAP, Sharepoint, … Large-scale source code analysis • Detection of “events” in data streams • Using the Amazon cloud • Metrics warehouse Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 22. Possible MFES projects at SIG Massively parallel source code analysis 112 I 112 • Use Hadoop framework for Map-Reduce • Put algebraic API on top • Construct example analyses Java library binary relational algebra • Extend to “labeled” relations (matrix algebra) • Extend with advanced algorithms (e.g. concept analysis) Randomized testing for Java • Study existing approaches • Build / extend tool Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.
  • 23. More info? Feel free to contact… 113 I 112 Dr. ir. Joost Visser E: j.visser@sig.nl W: www.sig.nl T: +31 20 3140950 Software Analysis and Testing, MFES Universidade do Minho by Joost Visser, Software Improvement Group © 2010.