1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Reverse Engineering.

Slides:



Advertisements
Similar presentations
SOFTWARE MAINTENANCE 24 March 2013 William W. McMillan.
Advertisements

© S. Demeyer, S. Ducasse, O. Nierstrasz Reverse Engineering.1 4. Reverse Engineering JEdit Experience What and Why Setting Direction  Most Valuable First.
Free Mini Course: Applying UML 2.0 with MagicDraw.
Module 2 Designing a Logical Database Model. Module Overview Guidelines for Building a Logical Database Model Planning for OLTP Activity Evaluating Logical.
Using UML, Patterns, and Java Object-Oriented Software Engineering Royce’s Methodology Chapter 16, Royce’ Methodology.
OORPT Object-Oriented Reengineering Patterns and Techniques 7. Problem Detection Prof. O. Nierstrasz.
© S. Demeyer, S. Ducasse, O. Nierstrasz Reverse Engineering.1 2. Reverse Engineering What and Why Setting Direction  Most Valuable First First Contact.
OORPT Object-Oriented Reengineering Patterns and Techniques 4. Reverse Engineering Prof. O. Nierstrasz.
1 Software Requirement Analysis Deployment Package for the Basic Profile Version 0.1, January 11th 2008.
Introduction to Software Engineering 13. Software Evolution.
Introduction To System Analysis and Design
CAP 252 Lecture Topic: Requirement Analysis Class Exercise: Use Cases.
Object-Oriented Reengineering Oscar Nierstrasz Software Composition Group University of Bern.
© S. Demeyer, S. Ducasse, O. Nierstrasz Reverse Engineering.1 3. Reverse Engineering What and Why Setting Direction  Most Valuable First First Contact.
Fundamentals of Information Systems, Second Edition
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
COMP 350: Object Oriented Analysis and Design Lecture 2
9 1 Chapter 9 Database Design Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Mastering OOA/OOD with UML. Contents Introduction Requirements Overview OOAOOD.
The Re-engineering and Reuse of Software
Release & Deployment ITIL Version 3
Introduction to RUP Spring Sharif Univ. of Tech.2 Outlines What is RUP? RUP Phases –Inception –Elaboration –Construction –Transition.
Software evolution. Objectives l To explain why change is inevitable if software systems are to remain useful l To discuss software maintenance and maintenance.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 1 Chapter 6 Requirements Engineering Process.
Module 4: Systems Development Chapter 13: Investigation and Analysis.
ITEC224 Database Programming
Demystifying the Business Analysis Body of Knowledge Central Iowa IIBA Chapter December 7, 2005.
Business Analysis and Essential Competencies
1 SYS366 Lecture 1: Introduction to Systems. 2 What is Software Development? Software Development implies developing some software – but it does not involve.
1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 1 Radu Marinescu Introduction to Object-Oriented Reengineering.
© S. Demeyer, S. Ducasse, O. Nierstrasz Intro.1 1. Introduction Goals Why Reengineering ?  Lehman's Laws  Object-Oriented Legacy Typical Problems  common.
Presented by Abirami Poonkundran.  Introduction  Current Work  Current Tools  Solution  Tesseract  Tesseract Usage Scenarios  Information Flow.
Introduction To System Analysis and Design
Information System Development Courses Figure: ISD Course Structure.
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
T Final demo I2 Iteration Agenda  Product presentation (20 min) ‏  Project close-up (20 min) ‏ Evaluation of the results  Questions.
Lecture 7: Requirements Engineering
Content The system development life cycle
IS2210: Systems Analysis and Systems Design and Change Twitter:
The Systems Development Life Cycle
Software Engineering Saeed Akhtar The University of Lahore Lecture 6 Originally shared for: mashhoood.webs.com.
Information Systems Engineering. Lecture Outline Information Systems Architecture Information System Architecture components Information Engineering Phases.
Notes of Rational Related cyt. 2 Outline 3 Capturing business requirements using use cases Practical principles  Find the right boundaries for your.
Systems Analysis and Design in a Changing World, Fourth Edition
Object-Oriented Software Engineering using Java, Patterns &UML. Presented by: E.S. Mbokane Department of System Development Faculty of ICT Tshwane University.
1 Object-Oriented Design in Practice. Could/Should We Do Better? Dr. Radu Marinescu Timişoara, Object-Oriented Design in Practice. Could/Should.
Fundamentals of Information Systems, Second Edition 1 Systems Development.
System Context and Domain Analysis Abbas Rasoolzadegan.
CS 772: Global Knowledge Networks V. “Juggy” Jagannathan CSEE, West Virginia University.
The Software Development Process
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 3 Radu Marinescu Detailed Model Capture  Details matter  Pay attention.
Business Analysis. Business Analysis Concepts Enterprise Analysis ► Identify business opportunities ► Understand the business strategy ► Identify Business.
MODEL-BASED SOFTWARE ARCHITECTURES.  Models of software are used in an increasing number of projects to handle the complexity of application domains.
Requirements Validation
Requirements Management with Use Cases Module 3: Analyze the Problem Requirements Management with Use Cases Module 3: Analyze the Problem.
Software Engineering Prof. Dr. Bertrand Meyer Dr. Manuel Oriol Dr. Bernd Schoeller Chair of Software Engineering Lectures 22: Legacy Software.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Module 4: Systems Development Chapter 13: Investigation and Analysis.
Requirements Engineering Processes. Syllabus l Definition of Requirement engineering process (REP) l Phases of Requirements Engineering Process: Requirements.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 21 Slide 1 Software evolution.
Requirement Engineering
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
1 SYS366 Week 1 - Lecture 1 Introduction to Systems.
5. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Describe the activities of the requirements discipline  Describe the difference.
1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 4 Radu Marinescu Design Extraction.
Session 6: Data Flow, Data Management, and Data Quality.
COMP 350: Object Oriented Analysis and Design Lecture 2
Presentation transcript:

1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Reverse Engineering

2 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Reverse Engineering  What and Why  Setting Direction  Most Valuable First  First Contact  Chat with the Maintainers  Interview during Demo  Initial Understanding  Analyze the Persistent Data  Study Exceptional Entities

3 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu What and Why ? Definition Reverse Engineering is the process of analysing a subject system  to identify the system’s components and their interrelationships and  create representations of the system  in another form or  at a higher level of abstraction. — Chikofsky & Cross, ’90 Motivation Understanding other people’s code  newcomers in the team,  code reviewing  original developers left Generating UML diagrams is NOT reverse engineering... but it is a valuable support tool

4 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu The Reengineering Life-Cycle (0) req. analysis (1) model capture issues scale speed accuracy politics Requirements Designs Code (0) requirement analysis (1) model capture (2) problem detection (3) problem resolution (4) program transformation

5 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Setting Direction  Conflicting interests  technical, ergonomic, economic, political  Presence/absence original developers  Legacy architecture  not the best  Which problems to tackle?  Interesting vs. important problems?  Wrap, refactor or rewrite?

6 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Setting Direction Agree on Maxims Set direction Appoint a Navigator Speak to the Round Table Maintain direction Coordinate direction Most Valuable First Where to start Fix Problems, Not Symptoms If It Ain't Broke Don't Fix It What not to do What to do Keep it Simple How to do it Principles & Guidelines for Software project management especially relevant for reengineering projects

7 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Most Valuable First Problem: Which problems should you focus on first? Solution: Work on aspects that are most valuable to your customer  Maximize commitment, early results  build confidence  Difficulties and hints:  Which stakeholder do you listen to?  What measurable goal to aim for?  Consult change logs for high activity  Play the Planning Game

8 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu First Contact  Where Do I Start?  Legacy systems are large and complex  Split the system into manageable pieces  Time is scarce  Apply lightweight techniques to assess feasibility and risks  First impressions are dangerous  Always double-check your sources

9 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu First Contact System experts Chat with the Maintainers Interview during Demo Talk with developers Talk with end users Talk about it Verify what you hear Software System Read All the Code in One Hour Do a Mock Installation Read itCompile it Skim the Documentation Read about it

10 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Chat with the Maintainers Problem: What are the history and politics of the legacy system? Solution: Discuss the problems with the system maintainers.  Documentation will mislead you (various reasons)  Stakeholders will mislead you (various reasons)  The maintainers know both the technical and political history

11 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Chat with the Maintainers Questions to ask:  Easiest/hardest bug to fix in recent months?  How are change requests made and evaluated?  How did the development/maintenance team evolve during the project?  How good is the code? The documentation?  Why was the reengineering project started? What do you hope to gain? The major problems of our work are not so much technological as sociological. DeMarco and Lister, Peopleware

12 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Read all the Code in One Hour Problem: How can you get a first impression of the quality of the source code? Solution: Scan all the code in single, short session.  Use a checklist  code review guidelines, coding styles etc.  Look for functional tests and unit tests  Look for abstract classes and root classes that define domain abstractions  Beware of comments  Log all your questions! I took a course in speed reading and read “War and Peace” in twenty minutes. It’s about Russia. Woody Allen

13 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Read all the Code in One Hour Pros  Start efficiently  code review guidelines, coding styles etc.  Judge sincerely  unbiased view of the software  Learn the developer's vocabulary Cons  Obtain low abstraction  Doest no scale  Comments may mislead you

14 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Initial Understanding  Data is deceptive  Always double-check your sources  Understanding entails iteration  Plan iteration and feedback loops  Knowledge must be shared  “Put the map on the wall”  Teams need to communicate  “Use their language”

15 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Initial Understanding understand  higher-level model Top down Speculate about Design Recover design Analyze the Persistent Data Study the Exceptional Entities Recover database Bottom up Identify problems

16 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Analyze the Persistent Data Problem: Which objects represent valuable data? Solution: Analyze the database schema  Prepare Model  tables  classes; columns  attributes  primary keys  naming conventions + unique indices  foreign keys (associations between classes)  be aware of synonyms and homonyms  Incorporate Inheritance  one to one; rolled down; rolled up  Incorporate Associations  association classes (e.g. many-to-many associations)  qualified associations  Verification  Data samples + SQL statements

17 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Example: One To One Patient id: char(5) insuranceID: char(7) insurance: char(5) Salesman id: char(5) company: char(40) Person id: char(5) name: char(40) addresss: char(60) Patient id: char(5) insuranceID: char(7) insurance: char(5) Salesman id: char(5) company: char(40) Person id: char(5) name: char(40) addresss: char(60)

18 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Example: Rolled Down Patient id: char(5) name: char(40) addresss: char(60) insuranceID: char(7) insurance: char(5) Salesman id: char(5) name: char(40) addresss: char(60) company: char(40) Patient id: char(5) insuranceID: char(7) insurance: char(5) Salesman id: char(5) company: char(40) Person id: char(5) name: char(40) addresss: char(60)

19 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Example: Rolled Up Person id: char(5) name: char(40) addresss: char(60) kind: integer insuranceID: char(7) «optional» insurance: char(5) «optional» company: char(40) «optional» Patient id: char(5) insuranceID: char(7) insurance: char(5) Salesman id: char(5) company: char(40) Person id: char(5) name: char(40) addresss: char(60)

20 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Study the Exceptional Entities Problem: How can you quickly identify design problems? Solution: Measure software entities and study the anomalous ones  Use simple metrics  Visualize metrics to get an overview  Browse the code to get insight into the anomalies

21 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Questions  Which tools to use?  Which metrics to collect?  Which thresholds to apply  How to interpret the results?  How to identify anomalies quickly?  Should I trust numbers?  What about normal entities?

22 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu CodeCrawler: Visualizing Metrics

23 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Initial Understanding (revisited) Top down Speculate about Design Analyze the Persistent Data Study the Exceptional Entities understand  higher-level model Bottom up ITERATION Recover design Recover database Identify problems