Program Comprehension – Program Slicing Part 2

Following up from Part 1 of this topic, let me conclude the Program Slicing topic by making an RPG example that should make it very clear. In this very simple example of Backward Slicing two files have new records written; the naming conventions should be self-explanatory for which fields are in which file. After Step 2, the five red statements represent the backward program slice for the WRITE CUSTFMT statement.  After Step 4, the three blue statements represent the backward program slice for the WRITE ITEMFMT ...

read more

Program Comprehension – Program Slicing Part 1

Have you ever tried to understand a large program by mentally paring away portions you weren’t concerned with?  If so, you were using Program Slicing.  In its original conception this technique was the process of deleting (slicing) statements from a program that are not relevant for understanding a particular statement and its variables.  In order to simplify the code being dealt with, the programmer sliced away unrelated statements for purposes of understanding a large or complex program.  The slicing activity could take place in temporary versions of source or simply in the...

read more

Program Comprehension – Key Statements Analysis

The final technique for Program Comprehension I’m going to talk about is Key Statements Analysis (KSA).  This is a process which requires some sort of automation as it involves a lot of computations.  I am considering trying this out for Codelyzer. KSA basically works by evaluating a large number of a program’s Program Slices.  One KSA method is done by using the backward program slicing technique and another method is done by using the forward program slicing technique. The KSA backward slice technique begins by identifying the set of variables that are output from the program plus...

read more

Program Comprehension – Concept Assignment Part 3

Before I talk about Concept Assignment using Static Analysis, let me explain why I think this is important and worthwhile reading for any AS/400 RPG developers or managers doing maintenance work:  I believe that the maintenance process can be significantly improved by anyone who makes the effort to understand what is actually going on in maintenance work.  I think most people just say, “go make these changes,” and that’s as much instruction as anyone typically gets.  But in fact, there are a great many ways the process can be improved – both speed and quality – and it...

read more

Program Comprehension – Concept Assignment Part 2

Concept Assignment through the use of Dynamic Analysis (aka, Dynamic Searching, Software Reconnaissance) is a means of locating the code that implements a given concept (a feature), by examining trace results from program executions.  In this type of analysis two runs of a program are executed.  One run causes the sought after feature to be executed and the other run causes the feature to not be executed.  The resulting sets of trace data are compared to find the statements that uniquely executed when the feature was run. For example, let’s say we want to find the code that...

read more

Program Comprehension – Concept Assignment Part 1

Concept Assignment occurs when a programmer maps his or her real world knowledge to particular lines of source code.  For example, a concept might be “we only give refunds for 30 days after the sale.”  To perform concept assignment the programmer would take that concept and attempt to find all the code related to its implementation. Let me say at the outset, Concept Assignment is one the most poorly understood and developed areas of software maintenance and program comprehension.  The problem is that to fully understand Concept Assignment means we must fully understand how people...

read more