Download Reengineering Patterns-Patterns in Software Engineering-Lecture 13 Slides-Computer Engineering and more Slides Software Engineering in PDF only on Docsity! Patterns in Software Engineering Lecturer: Raman Ramsin Lecture 13 Reengineering Patterns Part 1 Department of Computer Engineering 1 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Goal of Reengineering Reducing the complexity of a legacy system sufficiently so that it can continue to be used and adapted at an acceptable cost. Reasons for Reengineering Unbundling a monolithic system so that the individual parts can be more easily marketed separately or combined in different ways. Improving performance. Porting the system to a new platform. Extracting the design as a first step to a new implementation. E l iti t h l t t d tti i t txp o ng new ec no ogy as a s ep owar cu ng ma n enance cos s. Reducing human dependencies by documenting knowledge about the system and making it easier to maintain. Department of Computer Engineering 2 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Problems: Architectural Insufficient documentation: Documentation either does not exist or is inconsistent with reality. Improper layering: Missing or improper layering hampers portability and adaptability. Lack of modularity: Strong coupling between modules hampers evolution. D li t d d "C t d dit" i i k d b tup ca e co e: opy, pas e, an e s qu c an easy, u leads to maintenance nightmares. D li t d f ti lit Si il f ti lit i i l t dup ca e unc ona y: m ar unc ona y s re mp emen e by separate teams, leading to code bloat. Department of Computer Engineering 5 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Problems: Design Misuse of inheritance: For composition and code reuse rather than polymorphism Missing inheritance: Duplicated code and case statements to select behavior Misplaced operations: Excessive coupling Violation of encapsulation Class abuse: Lack of cohesion Department of Computer Engineering 6 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Patterns Reengineering patterns codify and record knowledge about modifying legacy software. They are stable units of expertise that can be consulted in any reengineering effort: they help in diagnosing problems and identifying weaknesses that may hinder further development of the system and , they aid in finding solutions that are more appropriate to the new requirements. Department of Computer Engineering 7 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Patterns: Categories (2) 6 Migration Strategies: help keep a system running while it is being. reengineered and increase the chances that the new system will be accepted by its users. 7. Detecting Duplicated Code: help identify locations where code may have been copied and pasted, or merged from different versions of the software. 8. Redistribute Responsibilities: help discover and reengineer classes with too many responsibilities. 9. Transform Conditionals to Polymorphism: help redistribute responsibilities when an object-oriented design has been compromised over time. Department of Computer Engineering 10 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Patterns: Setting Direction Problem: How do you establish a common sense of purpose in a team? Solution: Establish the key priorities for the project and identify guiding principles that will help the team to stay on track. Problem: Which problems should you focus on first? Solution: Start working on the aspects that are most valuable to your customer. Problem: Which parts of a legacy system should you reengineer and Problem: How do you maintain architectural vision during the course of a complex project? Solution: Appoint a specific person whose responsibility in the role of Navigator is to which should you leave as they are? Solution: Only fix the parts that are "broken"- those that can no longer be adapted to planned changes. ensure that the architectural vision is maintained. Problem: How do you keep your team synchronized? Solution: Hold brief regular round , table meetings. Problem: How can you possibly tackle all the reported problems? Solution: Address the source of a problem, th th ti l t f Problem: How much flexibility should you try to build into the new system? Solution: Prefer an adequate but simple solution to a potentially more Department of Computer Engineering 11 Sharif University of Technology ra er an par cu ar reques s o your Stakeholders. general but complex solution. Patterns in Software Engineering – Lecture 13 Reengineering Patterns: First Contact Problem: How can you get an idea of the typical usage scenarios and the main features of a software system? Solution: Observe the system in operation by seeing a demo and interviewing the person who is demonstrating. Problem: How do you get a good Problem: How do you identify those perspective on the historical and political context of the legacy system you are reengineering? Solution: Discuss the problem with the system maintainers. parts of the documentation that might be of help? Solution: Prepare a list summarizing interesting aspects of the system, match this list against the documentation, and make a crude assessment of how up to Problem: How can you get a first impression of the quality of the source code? Solution: Grant yourself a reasonably short amount of study time (e.g., approximately one hour) to read the source code; prepare a report of your findings date the documentation seems. Problem: How can you be sure that you will be able to (re)build the system? Solution: Try to install and build the . system in a clean environment during a limited amount of time (at most one day). Department of Computer Engineering 12 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Patterns: Tests Department of Computer Engineering 15 Sharif University of Technology Patterns in Software Engineering – Lecture 13 Reengineering Patterns: Migration Strategies Department of Computer Engineering 16 Sharif University of Technology Patterns in Software Engineering – Lecture 13 R fe erence Demeyer, S., Ducasse, S., and Nierstrasz, O., Object-Oriented Reengineering Patterns, Elsevier Science, 2003. Department of Computer Engineering 17 Sharif University of Technology