Code Slicing

Objectives

Code slicing, also known as code splitting, involves the removal of select data and process logic definitions from one source module into a new source module. A given module may result in two or more source modules that could be implemented as subroutines or as standalone programs in a subsequent job step. The resulting modules perform the same functions as the original. Specific objectives include:

· Reduce the size of cumbersome, monolithic source modules

· Eliminate code that no longer has a business function or use

· Improve system understandability where overly complex source modules are involved

· Realign code along more suitable functional boundaries

Note: The degree of functional realignment is limited under this remodularization task.

Entrance Criteria

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

· Determination of business objectives driving the slicing approach

· Completion of process flow analysis task of the technical assessment

· Application staging for code slicing candidates

· Completion of the code flaw analysis and removal

Note: This is required on all code being sliced.

· Completion of code restructuring where functional SME is not available or I/O consolidation is prerequisite

Note: Following is optional based on number of programs involved from a given system.

· Functional hierarchy analysis based on requirement to achieve some degree of functional realignment

Roles/Skills

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

· Process Positioning Expert

- Expertise in analyzing and performing code slicing on large modules using available tool set

· Current Systems Expert

- Knowledge of existing system source operational requirements and of the functionality of the programs being sliced

· Systems Programmer

- Security access to physical system objects

Input Requirements

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

· Application source code, Copy members and execution CONTROL LANGUAGE relating to programs being sliced

· Completed process flow analysis Form 003B

· Blank copy of Positioning work plan - Form 020

· Blank copy of Positioning control log - Form 022

Note: Optional - based on degree of programs involved from a given system

· Functional mapping Form 004 based on requirement to achieve some degree of functional realignment

Tool/Technology Support

Technologies supporting the code slicing task include code remodularization facility, restructuring, static analysis, open systems repository, spreadsheet, program editor, compiler/preprocessor, comparator, and word processing tools. These tools are used to represent information as required by this task.

Code remodularization facility

The main goal of a code remodularization facility in this task is to perform code slicing to carve out segmented functions of a program and to turn them into new called sub-programs. The slicing tool must be able to perform automated slicing based on multiple criteria.

Restructuring tool

In this task secondary support for code slicing, in the absence of a code slicing tool, includes restructuring tools. Because of their ability to identify and remove dead code from the restructured output, many of the restructuring tools can be used in conjunction with brief manual code changes to split programs.

Open systems repository

Use of repository in this task requires that a baseline meta-data was established during Inventory/Analysis, and has been kept up to date throughout any earlier positioning tasks. The main purpose for using the repository in this task is to update it with new source program objects, copybook objects, and related relationships as code slicing progresses. For large systems or cross functional expansion efforts, this repository model can be maintained as a sophisticated mechanism for managing project efforts.

Requirements include the ability to reflect system components as objects within the repository model and populate that model from a legacy environment. A recommended transition meta-model that supports this analysis is shown in the Appendix section of the Comsys-TIM product. A secondary, and optional, requirement involves accepting an automated load format based on tools that parse and analyze legacy environments.

Static analysis tool

The static analysis tool in this task must be able to graphically analyze code to produce information on how interrelated portions of code are. One example of this type of information is the dominance and reach metrics some of these tools can generate. The analysis is used to identify favorable split points at which to create reusable code.

Program editor

An on-line facility capable of serving as a source code editor to make modifications required by this task . Use a program editor appropriate to the environment.

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.

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 (see the step level tool guidelines for specific 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.

Task Steps

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

Develop Program Slicing Analysis
Perform Program Slicing Process
Perform Alternative Slicing Technique
Re-Configure Slice Related Components