1
CODE
RESTRUCTURING
INSTRUCTOR: ENGR. IQTIDAR SHAH
SE 446 Software Re-Engineering
SE 446 Software Re-Engineering
2 LECTURE BREAKDOWN
Code restructuring
Data restructuring
Restructuring tools
SE 446 Software Re-Engineering
3 CODE RESTRUCTURING
Software restructuring modifies source code and/or data in an effort to make it open to
future changes.
In general, restructuring does not modify the overall program architecture.
It tends to focus on the design details of individual modules and on local data structures
defined within modules.
If the restructuring effort extends beyond module boundaries and includes the software
architecture, restructuring becomes forward engineering
It is initiated when major parts of the software are serviceable and only a subset of all
modules and data need extensive modification
SE 446 Software Re-Engineering
4 CODE RESTRUCTURING CONT.
Code restructuring is performed to yield a design that produces the same function but
with higher quality than the original program.
In general, code restructuring techniques model program logic using Boolean algebra and
then apply a series of transformation rules that yield restructured logic.
The objective is to take unstructured and difficult-to-maintain code and derive a
procedural design that conforms to the structured programming philosophy.
Such code can be caused by several factors, such as volatile project requirements, lack of
programming style rules, and software engineers with insufficient ability or experience.
SE 446 Software Re-Engineering
5 CODE RESTRUCTURING CONT.
A resource exchange diagram maps each program module and the resources (data types,
procedures and variables) that are exchanged between it and other modules.
By creating representations of resource flow, the program architecture can be
restructured to achieve minimum coupling among modules.
SE 446 Software Re-Engineering
6 CODE RESTRUCTURING CONT.
Figure: Representation of cohesion and coupling among modules and functions
SE 446 Software Re-Engineering
7 CODE RESTRUCTURING CONT.
Figure: Representation of resource flow among modules
SE 446 Software Re-Engineering
8 DATA RESTRUCTURING
Before data restructuring can begin, analysis of source code should be conducted.
All programming language statements that contain data definitions, file descriptions, I/O,
and interface descriptions are evaluated.
The intent is to extract data items and objects, to get information on data flow, and
• to understand the existing data structures that have been implemented.
This activity is sometimes called data analysis.
Once data analysis has been completed, data redesign commences.
SE 446 Software Re-Engineering
9 DATA RESTRUCTURING CONT.
SE 446 Software Re-Engineering
10 DATA RESTRUCTURING CONT.
SE 446 Software Re-Engineering
11 DATA RESTRUCTURING CONT.
A data record standardization step clarifies data definitions to achieve consistency among data
item names or physical record formats within an existing data structure (arrays etc.) or file
format (pdf, docx, etc.).
Another form of redesign, called data name rationalization, ensures that all data naming
conventions conform to local standards and that aliases are eliminated as data flow through
the system.
When restructuring moves beyond standardization and rationalization, physical modifications
to existing data structures are made to make the data design more effective.
This may mean a translation from one file format to another, or in some cases, translation
from one type of database to another.
SE 446 Software Re-Engineering
12 RESTRUCTURING TOOLS
Objective: The objective of restructuring tools is to transform older unstructured
computer software into modern programming languages and design structures.
Mechanics: In general, source code is input and transformed into a better structured
program.
In some cases, the transformation occurs within the same programming language.
In other cases, an older programming language is transformed into a more modern
language.
SE 446 Software Re-Engineering
13 RESTRUCTURING TOOLS CONT.
DMS Software Reengineering Toolkit, developed by Semantic Design ([Link]),
provides a variety of restructuring capabilities for COBOL, C/C++, Java, Fortran 90, and VHDL.
Clone Doctor, developed by Semantic Designs, Inc. ([Link] ), analyzes and
transforms programs written in C, C++, Java, or COBOL or any other text-based computer language.
plusFORT, developed by Polyhedron ([Link] ) is a suite of FORTRAN tools that
contains capabilities for restructuring poorly designed FORTRAN programs into the modern
FORTRAN or C standard.
SE 446 Software Re-Engineering
14 ASSIGNMENT #1 SUBMISSION: 20/11/2024
• Q. Write abstract and objectives of your semester project and apply the following re
engineering techniques for maintaining and modifying the project.
• 1. Source code analysis
• 2. Reverse engineering
• 3. Architecture recovery
SE 446 Software Re-Engineering
15 QUESTIONS?