Software Re-engineering Software Re-engineering It is a process of software development which is done to improve the maintainability of a software system. Technical Definition: Software Re- engineering is the examination and alteration of a system to reconstitute it in a new form. This process encompasses a combination of sub-processes such as reverse engineering, restructuring, redocumentation, forward engineering, and retargeting. When to Re-engineer When system changes are mostly confined to part of the system then reengineer that part. When hardware or software support becomes obsolete When tools to support re-structuring are available When to re-engineer. Key advantages of Software Reengineering Reduced risk: There is a high risk in redeveloping software that is essential for an organization. Errors may be made in the system specification, there may be development problems etc. Reduced cost: The cost of re- engineering is significantly less than the costs of developing new software. Legacy Systems Legacy systems are old systems which are essential for business process support. Companies rely on these systems so they must keep them in operation. The majority of legacy systems have been written in COBOL, a programming language best suited to business data processing or FORTRAN, a programming language for scientific or mathematical programming. These languages have limited program structuring facilities and in the case of FORTRAN, very limited support for data structuring. Maintenance of these old systems is increasingly expensive so reengineering these system extends their useful life time. Re-engineering improves the system structure, creates new system documentation and makes it easier to understand. Re-engineering Vs New Software Development Forward Engineering System specification Design and implementation New system Understanding and transformation Re-engineered system Software Reengineering Existing system Re-engineering V/S New Software Development The critical difference between re- engineering and new software development (also called forward engineering) is the starting point for the development. Rather than start with a written specification, the old system acts as a specification for the new system. Re-engineering Process The input to the process is a legacy program and the output is the modularized version of the same program. As the same time as program re-engineering, the data for the system may also be re-engineered. The activities in this re-engineering process are: Source Code Translation, Reverse Engineering, Program Structure Improvement, Program Modularization, Data Re-engineering Re-engineering Process Source Code Translation The simplest form of s/w re-engineering is program translation where source code in one programming language is translated to source code in some other language. Source code translation is only economically realistic if an automated translator is available. In this process source in one programming language is automatically translated in source code in some other language. The target language may be an updated version of the original language(e.g. COBOL- 74 to COBOL-85) or may be a translated to a completely different language(e.g. FORTRAN to C) Source Code Translation System to be re-engineered System to be re-engineered Identify source code differences Design translator instructions Automatically translate code re-engineered system Manually translate code Why source code translation? It may be necessary for the following reasons. Hardware Platform Update: The organization may whish to change its standard h/w platform. Compilers for the original language may not be available on the new h/w. Staff skill shortages: There may be a lack of trained maintenance staff for the original language. This is a particular problem where programs were written in a non-standard language that has now gone out of general use. Organizational Policy Changes: An organization may decide to standardize on a particular language to minimize it support software costs. Maintaining many copies of old compilers can be very expensive. Lack of software support: The suppliers of the language may have gone out of business or may discontinue for their product. Reverse Engineering The objective of the reverse engineering is to derive the design and specification of a system from its source code. It is the process of analyzing a program in an effort to create a representation of the program at a higher level of abstraction than source code. Reverse Engineering Program structure diagrams Automated analysis System to be reengineered System information store Document generation Data structure diagrams Manual annotation Traceability metrices Program Structure Improvement Program restructuring modifies source code and/or data in an effort to make it easier for future changes. Easy to read and understand Unstructured control, complex conditions can also be simplified as part of the restructuring process. Complex condition: if not( A>B AND (C>D OR NOT (E>F)))… Simplified condition: if A<= B AND (C>=D OR E>F)… Use of structured control statements Program Structure Improvement It focuses on design details of individual modules and on local data structures defined within modules. The benefits of program restructuring are: i. Programs have higher quality-better documentation, less complexity, and conformance to modern s/w engineering practices and standards. ii. Frustration among s/w engineers who must work on the program is reduced, thereby improving productivity and making learning easier. iii. Efforts required to maintenance activities is reduced. iv. S/W is easier to test and debug. Program Modularization Program modularization is the process of reorganizing a program so that related parts are collected together and considered as a single module. Once this has been done, it becomes easier to remove redundancy in these related components, to optimize their interactions and to simplify their interface with the rest of the program. In some cases, this stage may involve architectural transformation. Program Modularization Several different types of module may be created during the program modularization process: Data Abstractions: These are abstract data types that are created by associating data with processing components. Hardware modules: These modules combines together all of the functions which are used to control a particular h/w device. Program Modularization Functional modules: These are modules which collect together functions that carry out similar or closely related tasks. For e.g. All of the functions concerned with input and input validation may be incorporated in a single module. Process support modules: These are modules where all of the functions and the specific data items required to support a particular business process are grouped. For e.g., in a library system, a process support module may include all of the functionality required to support issue and return of books. Data Re-engineering During the re-engineering process, the storage, organization and format of data processed by legacy programs may have to evolve to reflect changes to the software. The process of analyzing and reorganizing data structures and, sometimes, the data values in a system to make it more understandable is called data-reengineering. Various reasons for modifying the data are: i. Data Degradation: Over time, the quality of data tends to decline. Changes to the data introduces errors, duplicate values may have been created and changes to the external environment may not be reflected in the data. eg. Change in account no. format, e-mail address Data Re-engineering ii. Inherent limits that are built into the program: When originally designed, developers of many programs included built-inconstraints on the amount of data which would be processed. However, programs are now often required to process much more data that was originally specified by their developers. Data re-engineering may be required to remove the limitations iii. Architectural evolution: If a centralized system is migrated to a distributed architecture it is essential that the architecture should be a data management system that can be accessed from remote clients. This may require a large data re-engineering effort to move data from separate files into the server database management system. Cost of Re-engineering The cost of re-engineering depend on the extent of the work that is carried out. Cost increases from left to right so that source code translation is the cheapest option and re-engineering as part of the architectural migration is the most expensive. Apart from the extent of the re-engineering, the principal factors that affect re-engineering costs are: The quality of the software to re- engineered: The lower of the quality of the software and documentation(if any), the higher re- engineering costs. its associated Cost of Re-engineering The tool support available for re- engineering: The use of CASE tools to automate most of the program changes is normally cost effective to re-engineer a software. The extent of data conversion required: If re-engineering requires large volumes of data to be converted, this significantly increases the process cost. The availability of expert staff: If the staff responsible for maintaining the system can’t be involved in the re-engineering process, this will increase the costs. System re-engineers will have to spend a great deal of time understanding the system. Disadvantages of S/W Re- engineering Major architectural changes can’t be carried out automatically, so involve high additional costs. Although re-engineered system can improve maintainability, the reengineered system will probably not be as maintainable as new system developed using modern software engineering methods.