Code Restructuring

Objectives

Restructuring refers to the process of encoding program source logic that is defined using random or haphazard coding patterns and modifying these patterns to form a structured, more cohesive source program. The restructuring task has the following objectives:

· Create a cohesive, readable and standardized source program where logic paths are easy to analyze and easy to modify

· Impose organizational coding standards on existing source programs

· Eliminate packaging constructs and language specific verbs that are difficult to decipher and replace them with constructs and verbs that are easy to understand

· Impose source code formatting rules that comply with organizational coding standards

· Reduce program complexity and standardize coding styles to reduce the learning curve and improve the productivity of software maintenance personnel

Note: The steps described in this task are somewhat COBOL oriented, but can be extrapolated to other third generation languages as required. Entering this step without a structuring tool is not recommended.

Entrance Criteria

The entrance criteria for the code restructuring task is listed below.

· Completion of the Inventory/Analysis, process flow analysis task for the systems/programs of interest

· Completion of the code flaw analysis and removal Positioning task for the programs of interest

Note: If code flaw analysis & removal was performed on programs entering this task, updated metrics should be made available to this task.

· Directive to improve the understandability and maintainability of select programs and/or to prepare those programs for additional redevelopment activities

· Completion of the application staging task for programs/system of interest

Roles/Skills

The personnel and skill requirements necessary to meet the code restructuring task objectives are identified below.

· Process Positioning Expert

- Expertise in structuring code in the current system's source language(s)

· Current Systems Expert

- Knowledge of existing program/function breakdown

· Metric analyst

- Analyst conversant with metric tools and interpretation for source language type(s)

Input Requirements

The system components and related inputs required to initiate and complete the code restructuring task are listed below.

· Completion of the Inventory/Analysis, process flow analysis task for the systems/programs of interest

· Current/updated metric and supporting analysis reports as specified on Form 003A

Note: Reports must reflect the most recent source code versions including programs having undergone flaw analysis and removal as required in prior Positioning task.

· Current coding standards for the application language being restructured

· Production program source and Copy code loaded into Original and Input libraries

· Blank copy of Positioning control log - Form 022

· Blank copy of Positioning - work plan Form 020

Tool/Technology Support

Technologies supporting the code restructuring task include restructuring, static analysis, spreadsheet, word processing, compiler/preprocessors and comparator tools. These tools are used to represent information as required by this task.

Restructuring tool

In this task primary support for code restructuring comes in the highly automated form of a restructuring tool. Restructuring tools have been available for some time and are fairly mature products. Capabilities required in a restructuring tool include the ability to parse and analyze source code, determine all possible logic paths and recreate a functionally identical version of the program in structured form. The degree of flexibility in output formats and styles varies from tool to tool, but all allow the user some leeway in determining the format of the resultant code.

Static analysis tool

The static analysis tool in this task must be able to graphically analyze code to produce information on logic flow, program flaws and quality metrics. In some cases, the static analysis tool and restructuring tool are one in the same.

Spreadsheet

Spreadsheet tools offer a convenient format for recording much of the information gathered throughout this stage. Referenced Comsys-TIM Forms have been pre-loaded into certain spreadsheet tools to facilitate data entry and analysis. While highly desirable, spreadsheets are not essential to this task.

Word processor

In the absence of a spreadsheet tool, this is required to update Forms.

Compiler/preprocessors

A source language compiler/preprocessor is required to parse source code and convert it into machine executable instructions. This compilation process identifies many types of errors, and requires their correction before it will complete successfully.

Comparator

This tool is used to identify changes made to source code by comparing the input programs line by line and producing listings of any differences it finds.

Task Steps

The code restructuring task is comprised of the following task steps:

Create Detail Restructuring Analysis
Perform Program Structuring Adjustments
Establish Restructuring Parameters
Perform Source Code Restructuring