Software re engineering

34
Software Re- engineering Strategy for Software Change Indu Sharma HOD(CSE) CPTC, Rajsamand

Transcript of Software re engineering

Page 1: Software re engineering

Software Re-engineering

Strategy for Software Change

Indu SharmaHOD(CSE)

CPTC, Rajsamand

Page 2: Software re engineering

Introduction We have already discussed three

types of maintenance: Corrective Maintenance Adaptive Maintenance Perfective Maintenance

There is one more type of maintenance that is called:

Preventive Maintenance

Page 3: Software re engineering

Introduction Prevention (Preventive maintenance

or reengineering): Computer software deteriorates due to change, and because of this, preventive maintenance, often called software reengineering, must be conducted to enable the software to serve the needs of its end users. In this maintenance no new functionality is added to the system. Rather, the system is modified so that it can be more easily corrected, adapted, and enhanced.

Page 4: Software re engineering

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. Software evolution strategies include maintenance, replacement, architectural evolution and software re-engineering.

Page 5: Software re engineering

Legacy Systems 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.

Page 6: Software re engineering

Legacy Systems Maintenance of these old systems is

increasingly expensive so re-engineering these system extends their useful life time. Re-engineering a system is cost effective when it has a high business value but is maintain to expensive. Re-engineering improves the system structure, creates new system documentation and makes it easier to understand.

Page 7: Software re engineering

Software Re-Engineering Software re-engineering is concerned

with re-implementing legacy system to make them more maintainable. Re-engineering may involve re-documenting the system, organizing and restructuring the system, translating the system to more modern programming language and modifying and updating the structure and values of the system’s data.

Page 8: Software re engineering

Key Advantages or Re-engineering 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.

Page 9: Software re engineering

System Specification

Design & Implementation

New System

Forward Engineering

Existing s/w system

Understanding & transformation

Re-engineered System

Software Re-engineering

Re-engineering V/S New Software Development

Page 10: Software re engineering

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.

Page 11: Software re engineering

The Re-engineering Process

Reverseengineering

Programdocumentation

Datareengineering

Original data

Programstructure

improvement

Programmodularisation

Structuredprogram

Reengineereddata

ModularisedprogramOriginal

program

Source codetranslation

Page 12: Software re engineering

Re-engineering ProcessThe 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

Page 13: Software re engineering

I Source Code Translation

Automaticallytransla te code

Design translatorinstructions

Identify sourcecode differences

Manuallytransla te code

System to bere-engineered

System to bere-engineered

Re-engineeredsystem

Page 14: Software re engineering

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(eg. COBOL-74 to COBOL-85) or may be a translated to a completely different language(eg. FORTRAN to C)

Page 15: Software re engineering

Why source code translation? It may be necessary for the

following reasons.i. 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.

Page 16: Software re engineering

Why source code translation?

ii. 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.

iii. 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.

Page 17: Software re engineering

Why source code translation?

IV. Lack of software support: The suppliers of the language may have gone out of business or may discontinue for their product.

Page 18: Software re engineering

II Reverse Engineering Process

Data stucturediagrams

Program stucturediagrams

Traceabilitymatrices

Documentgeneration

Systeminformation

store

Automatedanalysis

Manualannotation

System to bere-engineered

Page 19: Software re engineering

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.

Page 20: Software re engineering

III 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

Page 21: Software re engineering

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.

Page 22: Software re engineering

Program Structure Improvement

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.

Page 23: Software re engineering

IV 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.

Page 24: Software re engineering

Program Modularization Several different types of module may

be created during the program modularization process:

i. Data Abstractions: These are abstract data types that are created by associating data with processing components.

ii. Hardware modules: These modules combines together all of the functions which are used to control a particular h/w device.

Page 25: Software re engineering

Program Modularizationiii. Functional modules: These are modules which

collect together functions that carry out similar or closely related tasks. For eg. All of the functions concerned with input and input validation may be incorporated in a single module.

iv. 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 eg., in a library system, a process support module may include all of the functionality required to support issue and return of books.

Page 26: Software re engineering

V Data Re-engineering Process

Entity namemodification

Literalreplacement

Data definitionre-ordering

Datare-formattingDefault value

conversionValidation rulemodification

Dataanalysis

Dataconversion

Dataanalysis

Modifieddata

Program to be re-engineered

Change summary tables

Stage 1 Stage 2 Stage 3

Page 27: Software re engineering

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.

Page 28: Software re engineering

Data Re-engineering 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

Page 29: Software re engineering

Data Re-engineeringii. Inherent limits that are built into the

program: When originally designed, developers of many programs included built-in-constraints 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

Page 30: Software re engineering

Data Re-engineeringiii. 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.

Page 31: Software re engineering

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:

Page 32: Software re engineering

Cost of Re-engineeringi. The quality of the software to

re-engineered: The lower of the quality of the software and its associated documentation(if any), the higher re-engineering costs.

ii. 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.

Page 33: Software re engineering

Cost of Re-engineeringiii. The extent of data conversion

required: If re-engineering requires large volumes of data to be converted, this significantly increases the process cost.

iv. 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.

Page 34: Software re engineering

Disadvantages of S/W Re-engineeringi. Practical limits to the extent that a system can

be improved by re-engineering. For eg. It is not possible to convert a system written using a functional approach to an object-oriented system.

ii. Major architectural changes can’t be carried out automatically, so involve high additional costs.

iii. Although re-engineered system can improve maintainability, the re-engineered system will probably not be as maintainable as new system developed using modern software engineering methods.