Software restructuring modifies source code and/or data in an effort to make it amenable to future changes. In general, restructuring does ...
Software restructuring modifies source code and/or data in an effort to make it amenable 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 encompasses the software architecture, restructuring becomes forward engineering .
Arnold defines a number of benefits that can be achieved when software is restructured:
• Programs have higher quality—better documentation, less complexity, and conformance to modern software engineering practices and standards.
• Frustration among software engineers who must work on the program is reduced, thereby improving productivity and making learning easier.
• Effort required to perform maintenance activities is reduced.
• Software is easier to test and debug.
Restructuring occurs when the basic architecture of an application is solid, even though technical internals need work. It is initiated when major parts of the software are serviceable and only a subset of all modules and data need extensive modification.
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 "spaghetti-bowl" code and derive a procedural design that conforms to the structured programming philosophy.
Other restructuring techniques have also been proposed for use with reengineering tools. 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.
Before data restructuring can begin, a reverse engineering activity called analysis of source code must 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. In its simplest form, a data record standardization step clarifies data definitions to achieve consistency among data item names or physical record formats within an existing data structure or file format. 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.