Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

42
Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn

Transcript of Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Page 1: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Software Reengineering

CIS 376

Bruce R. Maxim

UM-Dearborn

Page 2: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

System Reengineering

• Restructuring or rewriting part or all of a system without changing its functionality

• Applicable when some (but not all) subsystems of a larger system require frequent maintenance

• Reengineering involves putting in the effort to make it easier to maintain

• The reengineered system may also be restructured and should be redocumented

Page 3: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

When do you decide to reengineer?

• When system changes are confined to one subsystem, the subsystem needs to be reengineered

• When hardware or software support becomes obsolete

• When tools to support restructuring are readily available

Page 4: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering

• Concerned with redesigning business processes to make them more responsive and more efficient

• Often relies on the introduction of new computer systems to support the revised processes

• May force software reengineering of legacy computer systems which designed to support existing processes

Page 5: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering Principles - part 1

• Organize around outcomes, not tasks.• Have the people who use the output of a process,

perform the process.• Incorporate information processing work into the

work that produces the raw information.• Treat geographically dispersed resources as

though they were centralized.

Page 6: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering Principles - part 2

• Link parallel activities instead of integrating their results.

• Put the decision point where the work is performed and build control into the process.

• Capture the data once, at its source.

Page 7: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering Model - part 1

• Business redefinition– business goals identified in the context of key drivers

• cost reduction

• time reduction

• quality improvement

• empowerment

• Process identification– processes critical to achieving business goals are

identified and prioritized

Page 8: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering Model - part 2

• Process evaluation– existing processes are analyzed and measured

– process costs and time are noted

– quality/performance problems are isolated

• Process specification and design– use-cases are prepared for each process to be

redesigned (these use-case scenarios deliver some outcome to a customer)

– new tasks are designed for each process

Page 9: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Business Process Reengineering Model - part 3

• Prototyping– used to test processes before integrating them into the

business

• Refinement and instantiation– based on feedback from the prototype, business

processes are refined

– refined processes then instantiated within a business system

Page 10: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reengineering Processfrom Sommerville

Reverseengineering

Programdocumentation

Datareengineering

Original data

Programstructure

improvement

Programmodularisation

Structuredprogram

Reengineereddata

Modularisedprogram

Originalprogram

Source codetranslation

Page 11: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Software Reengineering Process Model - part 1

• Inventory analysis– sorting active software applications by business

criticality, longevity, current maintainability, and other local criteria

– helps to identify reengineering candidates

• Document restructuring options– live with weak documentation– update poor documents if they are used– fully rewrite the documentation for critical systems

focusing on the "essential minimum"

Page 12: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Software Reengineering Process Model - part 2

• Reverse engineering– process of design recovery

– analyzing a program in an effort to create a representation of the program at some abstraction level higher than source code

• Code restructuring– source code is analyzed and violations of structured

programming practices are noted and repaired

– revised code needs to be reviewed and tested

Page 13: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Software Reengineering Process Model - part 3

• Data restructuring– usually requires full reverse engineering

– current data architecture is dissected

– data models are defined

– existing data structures are reviewed for quality

• Forward engineering– sometimes called reclamation or renovation

– recovers design information from existing source code

– uses this design information to reconstitute the existing system to improve its overall quality or performance

Page 14: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Forward Engineering and Reengineeringfrom Sommerville

Understanding andtransformation

Existingsoftware system

Re-engineeredsystem

Design andimplementation

Systemspecification

Newsystem

Software re-engineering

Forward engineering

Page 15: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering

• Analyzing software with a view to understanding its design and specification

• May be part of the reengineering process• May be used to specify a system for prior to

reimplementation• Program understanding tools may be useful

(browsers, cross-reference generators, etc.)

Page 16: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Conceptspart 1

• Abstraction level– ideally want to be able to derive design information at

the highest level possible

• Completeness– level of detail provided at a given abstraction level

• Interactivity– degree to which humans are integrated with automated

reverse engineering tools

Page 17: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Conceptspart 2

• Directionality– one-way means the software engineer doing the

maintenance activity is given all information extracted from source code

– two-way means the information is fed to a reengineering tool that attempts to regenerate the old program

• Extract abstractions– meaningful specification of processing performed is

derived from old source code

Page 18: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Processfrom Sommerville

Data stucturediagrams

Program stucturediagrams

Traceabilitymatrices

Documentgeneration

Systeminformation

store

Automatedanalysis

Manualannotation

System to bere-engineered

Page 19: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Activitiespart 1

• Understanding process– source code is analyzed to at varying levels of detail

• system

• program

• component

• pattern

• statement

– to understand procedural abstractions and overall functionality

Page 20: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Activitiespart 2

• Understanding data– internal data structures

– database structure

• User interfaces– what are the basic actions (e.g. key strokes or mouse

operations) processed by the interface?

– what is a compact description of the system's behavioral response to these actions?

– what concept of equivalence of interfaces is relevant?

Page 21: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Reverse Engineering Applicability

• Reverse engineering often precedes reengineering• Sometimes reverse engineering is preferred

– if the specification and design of a system needs to be defined prior using them as input to the requirements specification process for a replacement systems

– if the design and specification for a system is needed to support program maintenance activities

Page 22: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Abstraction Recovery

• Many legacy systems make use of shared tables and global data structures to save space

• Results in tightly coupled systems that are very hard to change

• Shared data structures need to be transformed to objects or ADT’s

Page 23: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Creating ADT’s and Objects

• Analyze the data common areas to identify logical abstractions

• Create ADT’s or Objects for each abstraction• Provide functions or methods to update each field

in the data abstraction• Use a program browser to find all references to

these data structures and replace them with the new function or method calls

Page 24: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Sommerville’sRestructuring Approaches

Automated restructuringwith manual changes

Automated sourcecode conversion

Restructuring plusarchitectural changes

Automated programrestructuring

Program and datarestructuring

Increased cost

Page 25: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Restructuring Benefits

• Improved program and documentation quality• Makes programs easier to learn

– improves productivity

– reduces developer frustration

• Reduces effort required to maintain software• Software is easier to test and debug

Page 26: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Types of Restructuring - part 1

• Code restructuring– program logic modeled using Boolean algebra and

series of transformation rules are applied to yield restructured logic

– create resource exchange diagram showing• data types

• procedures

• variables shared between modules

– restructure program architecture to minimize module coupling

Page 27: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Types of Restructuring - part 2

• Data restructuring– analysis of source code

– data redesign

– data record standardization

– data name rationalization

– file or database translation

Page 28: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Automatic Program Restructuring from Sommerville

Graphrepresentation

Programgenerator

Restructuredprogram

Analyser andgraph builder

Program to berestructured

Page 29: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Automatic Restructuring Problems

• Loss of source code comments• Loss of documentation• Heavy computational demands• Will not help with poor modularization problems

(e.g. related components widely dispersed throughout the source code)

• The understandability of data driven programs may not be improved by restructuring

Page 30: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Source Code Translation

• Involves converting the code from one language (or language version) to another

• May be necessary because of – hardware platform updates

– staff skill shortages

– organizational policy changes

• May only be realistic (e.g. cost and time effective) if an automatic translator is available

• Manual fine tuning of new code is always required

Page 31: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Program Translation Processfrom Sommerville

Automaticallytransla te code

Design translatorinstructions

Identify sourcecode differences

Manuallytransla te code

System to bere-engineered

System to bere-engineered

Re-engineeredsystem

Page 32: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Reengineering

• Involves analyzing and reorganizing data structures or data values used in a program

• Might be part of the process of migrating from a file-based system to a DBMS or changing from one DBMS to another DBMS

• The goal to create an environment where is managed not just used

Page 33: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Rengineering Approaches - part 1

• Data cleanup– data records and values are analyzed to improve

quality– duplicates removed– redundant information is deleted– consistent format applied to all records– normally does not require and program changes

Page 34: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Reengineering Approaches - part 2

• Data extension– data and programs are reengineered to remove

data processing limits (e.g. size or field widths)– data itself may need to rewritten to reflect

program changes

• Data migration– data is moved to modern DBMS– data might be stored in separate files or an older

DBMS

Page 35: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Problems

• Data naming problems– names be hard to understand

– heavy use of aliasing by programmers

• Field length problems– different field lengths used for same data item in different

programs

• Record organization problems– different field orderings used by different programs

• Hard-coded literals

• No data dictionary

Page 36: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Value Inconsistencies

• Inconsistent default values used in different programs (e.g. especially missing data codes)

• Inconsistent units used for same quantity (e.g. miles in one program kilometers in another)

• Inconsistent validation rules (e.g. different standards used to reject values as bad)

• Inconsistent representation semantics (e.g. multiple ways of using uppercase to convey meaning in text strings)

• Inconsistent handling of negative numbers (e.g. data validation and representation issues)

Page 37: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Data Reengineering Processfrom Sommerville

Entity namemodification

Literalreplacement

Data definitionre-ordering

Datare-formattingDefault value

conversion

Validation rulemodification

Dataanalysis

Dataconversion

Dataanalysis

Modifieddata

Program to be re-engineered

Change summary tables

Stage 1 Stage 2 Stage 3

Page 38: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Forward Engineering Client/Server Architectures

• application functionality migrates to each client computer

• new GUI interfaces implemented at client sites• database functions allocated to servers• specialized functionality may remain at server site• new communications, security, archiving, and

control requirements must be established at both client and server sites

Page 39: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Forward Engineering Object-Oriented Architectures - part 1

• existing software is reverse engineered so that appropriate data, functional, and behavioral models can be created

• use-cases are created if reengineered system extends functionality of application

• data models created during reverse engineering are used with CRC modeling as a basis to define classes

Page 40: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Forward Engineering Object-Oriented Architectures - part 2

• create class hierarchies, object-relationship models, object-behavior models and begin object-oriented design

• a component-based process model may be used if a robust component library already exists

• where components must be built from scratch, it may be possible to reuse algorithms and data structures from the original application

Page 41: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Forward Engineering User Interfaces

• understand the original user interface and how the data moves between the user interface and the remainder of the application

• remodel the behavior implied by the existing user interface into a series of abstractions that have meaning in the context of a GUI

• introduce improvements that make the mode of interaction more efficient

• build and integrate the new GUI

Page 42: Software Reengineering CIS 376 Bruce R. Maxim UM-Dearborn.

Economics of Reengineering

• Cost of maintenance = cost annual of operation and maintenance over application lifetime

• Cost of reengineering = predicted return on investment reduced by cost of implementing changes and engineering risk factors

• Cost benefit = Cost of reengineering - Cost of maintenance