OORPT Object-Oriented Reengineering Patterns and Techniques 1. Introduction Prof. O. Nierstrasz.

Slides:



Advertisements
Similar presentations
© S. Demeyer, S. Ducasse, O. Nierstrasz Migration Testing and Migration What and Why  Reengineering Life-Cycle Tests: Your Life Insurance !  Grow.
Advertisements

© S. Demeyer, S. Ducasse, O. Nierstrasz Reverse Engineering.1 4. Reverse Engineering JEdit Experience What and Why Setting Direction  Most Valuable First.
OORPT Object-Oriented Reengineering Patterns and Techniques 7. Problem Detection Prof. O. Nierstrasz.
Stéphane Ducasse2.1 OOP? What is OOP? Why? OOP in a nutshell.
Unified theory of software evolution Reengineering – Business process reengineering and software reengineering BPR model – Business definition, process.
© 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.
Introduction to Software Engineering 13. Software Evolution.
Introduction To System Analysis and Design
Object-Oriented Reengineering Patterns and Techniques Prof. O. Nierstrasz Prof. S. Ducasse T.
12. Summary, Trends, Research. © O. Nierstrasz PS — Summary, Trends, Research Roadmap  Summary: —Trends in programming paradigms  Research:...
ESE Einführung in Software Engineering N. XXX Prof. O. Nierstrasz Fall Semester 2009.
The Software Composition Group Prof. O. Nierstrasz
Object-Oriented Reengineering Oscar Nierstrasz Software Composition Group University of Bern.
© S. Demeyer, S. Ducasse, O. Nierstrasz Intro.1 1. Introduction Goals Why Reengineering ?  Lehman's Laws  Object-Oriented Legacy Typical Problems  common.
Introduction to Software Evolution and Maintenance
Software Evolution Managing the processes of software system change
13. Summary, Trends, Research. © O. Nierstrasz PS — Summary, Trends, Research Summary, Trends, Research...  Summary: functional, logic and object-oriented.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Metamodeling Seminar X. CHAPTER Prof. O. Nierstrasz Spring Semester 2008.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 21 Slide 1 Software evolution.
Programmierung 2 Object-Oriented Programming with Java Prof. O. Nierstrasz Sommersemester 2006.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
N. XXX Prof. O. Nierstrasz Thanks to Jens Palsberg and Tony Hosking for their kind permission to reuse and adapt the CS132 and CS502 lecture notes.
© S. Demeyer, S. Ducasse, O. Nierstrasz Migration.1 5. Testing and Migration What and Why  Reengineering Life-Cycle Tests: Your Life Insurance !  Grow.
OORPT Object-Oriented Reengineering Patterns and Techniques 10. Testing and Migration Prof. O. Nierstrasz.
12. Summary, Trends, Research. © O. Nierstrasz PS — Summary, Trends, Research Roadmap  Summary: —Trends in programming paradigms  Research:...
Object-Oriented Reengineering Patterns and Techniques Prof. O. Nierstrasz Prof. S. Ducasse T.
Software evolution.
© S. Demeyer, S. Ducasse, O. Nierstrasz Chapter.1 MakeMoney Corp. C*O of MakeMoney Corp. Our Vision  We invest in software  We do not know software 
OORPT Object-Oriented Reengineering Patterns and Techniques X. CHAPTER Prof. O. Nierstrasz.
CP — Concurrent Programming X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
12. eToys. © O. Nierstrasz PS — eToys 12.2 Denotational Semantics Overview:  … References:  …
Software Reengineering 2003 년 12 월 2 일 최창익, 고광 원.
Chapter 9 – Software Evolution and Maintenance
SEG Software Maintenance1 Software Maintenance “The modification of a software product after delivery to correct faults, to improve performance or.
Software evolution. Objectives l To explain why change is inevitable if software systems are to remain useful l To discuss software maintenance and maintenance.
TOPIC R Software Maintenance, Evolution, Program Comprehension, and Reverse Engineering SEG4110 Advanced Software Design and Reengineering.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27Slide 1 Software change l Managing the processes of software system change.
Software Engineering Lecture 20 Software Maintenance.
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.
Introduction To System Analysis and Design
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27Slide 1 Software change l Managing the processes of software system change.
 CS 5380 Software Engineering Chapter 9 Software Evolution.
Chapter 11 Maintaining the System System evolution Legacy systems Software rejuvenation.
Object-Oriented Reengineering Patterns 1. Introduction.
Manag ing Software Change CIS 376 Bruce R. Maxim UM-Dearborn.
Object Oriented Reverse Engineering JATAN PATEL. What is Reverse Engineering? It is the process of analyzing a subject system to identify the system’s.
S.Ducasse Stéphane Ducasse 1 Object-Oriented Programming.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28Slide 1 CO7206 System Reengineering 4.2 Software Reengineering Most slides are Slides.
Chapter 5: Software Re-Engineering Omar Meqdadi SE 3860 Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
HNDIT23082 Lecture 06:Software Maintenance. Reasons for changes Errors in the existing system Changes in requirements Technological advances Legislation.
Software Engineering Prof. Dr. Bertrand Meyer Dr. Manuel Oriol Dr. Bernd Schoeller Chair of Software Engineering Lectures 22: Legacy Software.
Chapter 2: Software Maintenance Omar Meqdadi SE 3860 Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 21 Slide 1 Software evolution.
Chapter 9 – Software Evolution 1Chapter 9 Software evolution.
CS223: Software Engineering Lecture 32: Software Maintenance.
Introduction to Software Evolution and Maintenance
Managing the System PPT SOURCE : Shari L. Pfleeger Joann M. Atlee.
Software Maintenance
Software Maintenance PPT By :Dr. R. Mall.
Software Re-engineering - Theoretical and Practical Approaches
IS301 – Software Engineering V:
Software Maintenance Main issues: why maintenance is such an issue
Software Maintenance Main issues: why maintenance is such an issue
Chapter 8 Software Evolution.
Lecture 06:Software Maintenance
Introduction Software maintenance:
Presentation transcript:

OORPT Object-Oriented Reengineering Patterns and Techniques 1. Introduction Prof. O. Nierstrasz

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.2 OORPT Lecturer Prof. Oscar Nierstrasz Schützenmattstr. 14/103, Tel Assistants Dr. Tudor Gîrba, Adrian Kuhn Lectures IWI 001, 10h15-12h00 Exercises IWI 001, 12h00-13h00 WWW listwww.iam.unibe.ch/mailman/listinfo/oorpt-vorlesung Text “Object-Oriented Reengineering Patterns,” Serge Demeyer, Stéphane Ducasse and Oscar Nierstrasz, Morgan Kaufmann and DPunkt, 2002, ISBN

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.3 Roadmap  Goals of this course  Why Reengineer? —Lehman's Laws —Object-Oriented Legacy  Typical Problems —common symptoms —architectural problems & refactoring opportunities  Reverse and Reengineering —Definitions —Techniques —Patterns

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.4 Roadmap  Goals of this course  Why Reengineer? —Lehman's Laws —Object-Oriented Legacy  Typical Problems —common symptoms —architectural problems & refactoring opportunities  Reverse and Reengineering —Definitions —Techniques —Patterns

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.5 Goals of this course We will try to convince you:  Yes, Virginia, there are object-oriented legacy systems too!  Reverse engineering and reengineering are essential activities in the lifecycle of any successful software system. (And especially OO ones!)  There is a large set of lightweight tools and techniques to help you with reengineering.  Despite these tools and techniques, people must do job and they represent the most valuable resource.

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.6 Course Schedule WeekDateLesson 125-Oct-06Introduction 21-Nov-06Lab — understanding legacy software 38-Nov-06Presentation of results (all groups) 415-Nov-06Reverse Engineering 522-Nov-06Visualization for Program Understanding 629-Nov-06Design Extraction and Visualization 76-Dec-06Problem Detection and Duplicated Code 813-Dec-06Restructuring 920-Dec-06Lab — using reengineering tools 1010-Jan-07Meta-modeling 1117-Jan-07Architectural Extraction 1224-Jan-07Testing and Migration Strategies 1331-Jan-07TBA 147-Feb-07Final Exam

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.7 list Please register yourself in the course mailing list!

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.8 Roadmap  Goals of this course  Why Reengineer? —Lehman's Laws —Object-Oriented Legacy  Typical Problems —common symptoms —architectural problems & refactoring opportunities  Reverse and Reengineering —Definitions —Techniques —Patterns

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.9 What is a Legacy System ? “legacy” A sum of money, or a specified article, given to another by will; anything handed down by an ancestor or predecessor.— Oxford English Dictionary  so, further evolution and development may be prohibitively expensive A legacy system is a piece of software that: you have inherited, and is valuable to you. Typical problems with legacy systems: original developers not available outdated development methods used extensive patches and modifications have been made missing or outdated documentation

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.10 Software Maintenance - Cost requirement design coding testing delivery x 1 x 5 x 10 x 20 x 200 Relative Maintenance Effort Between 50% and 75% of global effort is spent on “maintenance” ! Relative Cost of Fixing Mistakes Solution ? Better requirements engineering? Better software methods & tools (database schemas, CASE-tools, objects, components, …)? Solution ? Better requirements engineering? Better software methods & tools (database schemas, CASE-tools, objects, components, …)?

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.11 Continuous Development 17.4% Corrective (fixing reported errors) 18.2% Adaptive (new platforms or OS) 60.3% Perfective (new functionality) The bulk of the maintenance cost is due to new functionality  even with better requirements, it is hard to predict new functions The bulk of the maintenance cost is due to new functionality  even with better requirements, it is hard to predict new functions data from [Lien78a] 4.1% Other

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.12 Lehman's Laws A classic study by Lehman and Belady [Lehm85a] identified several “laws” of system change. Continuing change  A program that is used in a real-world environment must change, or become progressively less useful in that environment. Increasing complexity  As a program evolves, it becomes more complex, and extra resources are needed to preserve and simplify its structure. Those laws are still applicable…

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.13 What about Objects ? Object-oriented legacy systems  = successful OO systems whose architecture and design no longer responds to changing requirements Compared to traditional legacy systems  The symptoms and the source of the problems are the same  The technical details and solutions may differ OO techniques promise better  flexibility,  reusability,  maintainability  …  they do not come for free

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.14 What about Components ? Components can be very brittle … After a while one inevitably resorts to glue :-) Components can be very brittle … After a while one inevitably resorts to glue :-)

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.15 (*) process-oriented structured methods, information engineering, data-oriented methods, prototyping, CASE-tools – not OO ! Contradiction ?No! modern methods make it easier to change... this capacity is used to enhance functionality! Contradiction ?No! modern methods make it easier to change... this capacity is used to enhance functionality! Modern Methods & Tools ? [Glas98a] quoting empirical study from Sasa Dekleva (1992)  Modern methods (*) lead to more reliable software  Modern methods lead to less frequent software repair  and...  Modern methods lead to more total maintenance time

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.16 How to deal with Legacy ? New or changing requirements will gradually degrade original design … unless extra development effort is spent to adapt the structure New Functionality Hack it in ? duplicated code complex conditionals abusive inheritance large classes/methods First … refactor restructure reengineer Take a loan on your software  pay back via reengineering Take a loan on your software  pay back via reengineering Investment for the future  paid back during maintenance Investment for the future  paid back during maintenance

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.17 Roadmap  Goals of this course  Why Reengineer? —Lehman's Laws —Object-Oriented Legacy  Typical Problems —common symptoms —architectural problems & refactoring opportunities  Reverse and Reengineering —Definitions —Techniques —Patterns

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.18 Common Symptoms Lack of Knowledge  obsolete or no documentation  departure of the original developers or users  disappearance of inside knowledge about the system  limited understanding of entire system  missing tests Lack of Knowledge  obsolete or no documentation  departure of the original developers or users  disappearance of inside knowledge about the system  limited understanding of entire system  missing tests Process symptoms  too long to turn things over to production  need for constant bug fixes  maintenance dependencies  difficulties separating products  simple changes take too long Process symptoms  too long to turn things over to production  need for constant bug fixes  maintenance dependencies  difficulties separating products  simple changes take too long Code symptoms duplicated code code smells  big build times Code symptoms duplicated code code smells  big build times

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.19 Common Problems Architectural Problems  insufficient documentation = non-existent or out-of-date  improper layering = too few or too many layers  lack of modularity = strong coupling  duplicated code = copy, paste & edit code  duplicated functionality = similar functionality by separate teams Architectural Problems  insufficient documentation = non-existent or out-of-date  improper layering = too few or too many layers  lack of modularity = strong coupling  duplicated code = copy, paste & edit code  duplicated functionality = similar functionality by separate teams Refactoring opportunities  misuse of inheritance = code reuse vs polymorphism  missing inheritance = duplication, case-statements  misplaced operations = operations outside classes  violation of encapsulation = type-casting; C++ "friends"  class abuse = classes as namespaces Refactoring opportunities  misuse of inheritance = code reuse vs polymorphism  missing inheritance = duplication, case-statements  misplaced operations = operations outside classes  violation of encapsulation = type-casting; C++ "friends"  class abuse = classes as namespaces

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.20 FAMOOS Case Studies Different reengineering goals … but common themes and problems ! DomainLOCReengineering Goal pipeline planning55,000extract design user interface60,000increase flexibility embedded switching180,000improve modularity mail sorting350,000portability & scalability network management2,000,000unbundle application space mission2,500,000identify components

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.21 Roadmap  Goals of this course  Why Reengineer? —Lehman's Laws —Object-Oriented Legacy  Typical Problems —common symptoms —architectural problems & refactoring opportunities  Reverse and Reengineering —Definitions —Techniques —Patterns

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.22 Some Terminology “Forward Engineering is the traditional process of moving from high- level abstractions and logical, implementation-independent designs to the physical implementation of a system.” “Reverse Engineering is the process of analyzing 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.” “Reengineering... is the examination and alteration of a subject system to reconstitute it in a new form and the subsequent implementation of the new form.” — Chikofsky and Cross [in Arnold, 1993]

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.23 Goals of Reverse Engineering  Cope with complexity —need techniques to understand large, complex systems  Generate alternative views —automatically generate different ways to view systems  Recover lost information —extract what changes have been made and why  Detect side effects —help understand ramifications of changes  Synthesize higher abstractions —identify latent abstractions in software  Facilitate reuse —detect candidate reusable artifacts and components — Chikofsky and Cross [in Arnold, 1993]

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.24 Reverse Engineering Techniques  Redocumentation —pretty printers —diagram generators —cross-reference listing generators  Design recovery —software metrics —browsers, visualization tools —static analyzers —dynamic (trace) analyzers

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.25 Goals of Reengineering  Unbundling —split a monolithic system into parts that can be separately marketed  Performance —“first do it, then do it right, then do it fast” — experience shows this is the right sequence!  Port to other Platform —the architecture must distinguish the platform dependent modules  Design extraction —to improve maintainability, portability, etc.  Exploitation of New Technology —i.e., new language features, standards, libraries, etc.

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.26 Reengineering Techniques  Restructuring —automatic conversion from unstructured to structured code —source code translation — Chikofsky and Cross  Data reengineering —integrating and centralizing multiple databases —unifying multiple, inconsistent representations —upgrading data models — Sommerville, ch 32  Refactoring —renaming/moving methods/classes etc.

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.27 The Reengineering Life-Cycle Requirements Designs Code (0) requirement analysis (1) model capture (2) problem detection (3) problem resolution (4) program transformation people centric lightweight

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.28 Reverse engineering Patterns Reverse engineering patterns encode expertise and trade-offs in extracting design from source code, running systems and people. —Even if design documents exist, they are typically out of sync with reality. Example: Interview During Demo

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.29 Reengineering Patterns Reengineering patterns encode expertise and trade-offs in transforming legacy code to resolve problems that have emerged. —These problems are typically not apparent in original design but are due to architectural drift as requirements evolve Example: Move Behaviour Close to Data

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.30 A Map of Reengineering Patterns Tests: Your Life Insurance Detailed Model Capture Initial Understanding First Contact Setting Direction Migration Strategies Detecting Duplicated Code Redistribute Responsibilities Transform Conditionals to Polymorphism

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.31 Summary  Software “maintenance” is really continuous development  Object-oriented software also suffers from legacy symptoms  Reengineering goals differ; symptoms don’t  Common, lightweight techniques can be applied to keep software healthy

© Stéphane Ducasse, Serge Demeyer, Oscar Nierstrasz OORPT — Introduction 1.32 License > Attribution-ShareAlike 2.5 You are free: to copy, distribute, display, and perform the work to make derivative works to make commercial use of the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. Attribution-ShareAlike 2.5 You are free: to copy, distribute, display, and perform the work to make derivative works to make commercial use of the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above.