chapter 5: software re-engineering omar meqdadi se 3860 lecture 5 department of computer science and...

Post on 14-Jan-2016

224 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Chapter 5: Software

Re-Engineering

Omar MeqdadiSE 3860 Lecture 5

Department of Computer Science and Software Engineering University of Wisconsin-Platteville

2

Topic Covered

Software Re-engineering Life-Cycle of Software Re-engineering Reverse Engineering Software Re-engineering Process

3

Definitions

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 a higher level of abstraction.

4

Definitions

Reengineering - Reorganising and modifying existing software systems to make them more maintainable by first reverse engineering and then forward engineering

Refactoring - A program restructuring (rearranging) in a series of small, semantics preserving transformations in order to make the code easier to maintain and modify

Forward Engineering Reverse Engineering

Requirements

Analysis

Design

Implementation

Forward Engineering and Reverse Engineering

6

Forward Engineering and Re-Engineering

7

System Re-engineering

A Preventive Maintenance activity Re-structuring or re-writing part or all of a legacy system

without changing its functionality Applicable where some but not all sub-systems of a larger

system require frequent maintenance Re-engineering involves adding effort to make them

easier to maintain. The system may be re-structured and re-documented.

8

When to Re-engineer?

Port to other Platform when hardware or software support becomes obsolete

Design extraction to improve maintainability, portability, etc.

Exploitation of New Technology new language features, standards, libraries, etc. when tools to support restructuring are readily available

9

Re-engineering Advantages

Reduced risk There is a high risk in new software development. There

may be development problems, staffing problems and specification problems

Reduced cost The cost of re-engineering is often significantly less than

the costs of developing new software

10

Re-engineering Cost Factors

The quality of the software to be re-engineered The tool support available for re-engineering The extent of the data conversion which is required The availability of expert staff for re-engineering

11

Re-engineering Cost

Life-Cycle of Re-engineering

Requirements

Designs

Code

(1) requirementanalysis

(2) modelcapture

(3) problemdetection (4) problem

resolution

(5) program transformation

• people centric• lightweight

Life-Cycle of Re-engineering

Reverse Engineering Phase Requirement analysis: analyze on which parts of your

requirements have changed Model capture: reverse engineer from the source-code into a more

abstract form, typically some form of a design model

Forwarded Engineering Phase Problem detection: identify design problems in that abstract model Problem resolution: propose an alternative design that will solve

the identified problem Program transformations: make the necessary changes to the

code, so that it adheres to the new design yet preserves all the required functionality

14

Re-engineering Process Activities

Source code translation Convert code to a new language

Reverse engineering Analyze the program to understand it

Program structure improvement Restructure automatically for understandability

Design recovery and reimplementation Program modularization

Reorganize the program structure

Data reengineering Clean-up and restructure system data

15

Source Code Translation

Involves converting the code from one language (or language version) to another e.g. FORTRAN to C

May be necessary because of: Hardware platform update Staff skill shortages Organisational policy changes

Only realistic if an automatic translator is available

16

Source Code Translation

17

Reverse Engineering

Program Comprehension Analysing existing software with a view to understand its

design and specification Systematic process of acquiring important design factors

and information regarding engineering aspects from an existing product

A process which analyses a product/technology to find out the design aspects and its functions

Builds a program data base and generates information from this

18

Reverse Engineering Goals

Cope with complexity need techniques to understand large, complex 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

19

Reverse Engineering Activities

Understanding process source code is analyzed to at varying levels of detail to understand procedural abstractions and overall

functionality Understanding data

internal data structures database structure

Understanding user interfaces what are basic actions processed by the interface? what is system's behavioral response to these actions?

20

Reverse Engineering Process

21

Reverse Engineering Techniques

Re-documentation pretty printers diagram generators cross-reference listing generators

Design recovery software metrics browsers visualization tools static analyzers dynamic (trace) analyzers

22

Reverse Engineering for Software Maintenance

Corrective maintenance: Easier to identify defective program components and the

source of residual errors

Adaptive/Perfective maintenance: Eases understanding of system’s components and their

interrelationships, showing where new requirements fit and how they relate to existing components

Preventive Maintenance Represent the first phase of the re-engineering process

23

Code Restructuring (Refactoring)

Maintenance tends to corrupt the structure of a program. It becomes harder and harder to understand

So, the program may be automatically restructured Source code is analyzed and violations of structured

programming practices are noted and repaired Examples:

Remove unconditional branches Conditions may be simplified to make them more readable

Revised code needs to be reviewed and tested

24

Code Restructuring (Refactoring)

Example1: Spaghetti logic

25

Code Restructuring (Refactoring)

Example1: Structured control logic

26

Code Restructuring (Refactoring)

Example2: Condition simplification

-- Complex conditionif not (A > B and (C < D or not ( E > F) ) )...

-- Simplified conditionif (A <= B and (C>= D or E > F)...

27

Program Modularization

The process of re-organising a program so that related program parts are collected together in a single module

Usually a manual process that is carried out by program inspection and re-organisation

28

Module Types

Data abstractions Abstract data types where data structures and associated operations are

grouped Hardware modules

All functions required to interface with a hardware unit Functional modules

Modules containing functions that carry out closely related tasks Process support modules

Modules where the functions support a business process or process fragment

29

Data Re-Engineering

Involves analysing and reorganising the data structures (and sometimes the data values) in a program

Existing data structures are reviewed for quality Integrating and centralizing multiple databases Unifying multiple, inconsistent representations Upgrading data models Objective is to create a managed data environment

30

Data Problems

End-users want data on their desktop machines rather than in a file system.

Systems may have to process much more data than was originally intended by their designers

Redundant data may be stored in different formats in different places in the system

Data naming problems Names may be hard to understand. The same data may have different

names in different programs

31

Data Problems

Field length problems The same item may be assigned different lengths in different

programs Record organisation problems

Records representing the same entity may be organised differently in different programs

Hard-coded literals No data dictionary

32

Data Re-engineering Approaches

33

Data Re-engineering Process

34

Data Conversion

Changing the data structure organisation without changing the data values

Data value conversion is very expensive. Special-purpose programs have to be written to carry out the conversion

top related