Home: Reengineering Up: Fundamental Methods in Reverse Design Previous: Data Centered Program Understanding Next: Others

Taxonomy Item Program Slicing

A program slice is a fragment of a program in which some statements are omitted that are not necessary to understand a certain property of the program. For example someone is interested in how the value for the out parameter r2 is computed in the following program:
 procedure myproc(a, b, c : integer; r1, r2 : out integer) is
 v, w : integer := 0;
 begin
 for i in 1..a loop
 w := w + b;
 end loop;

 for i in 1..c loop
 v := i*b + c + v;
 end loop;

 r1 := w;
 r2 := v*2;
 end myproc;
 
All he/she needs to know is the following program slice which is obviously easier to understand:
 procedure myproc( ... b, c : integer; ... r2 : out integer) is
 v, ... : integer := 0;
 begin
 ...

 for i in 1..c loop
 v := i*b + c + v;
 end loop;

 ...
 r2 := v*2;
 end myproc;
 

koschke@informatik.uni-stuttgart.de (Feedback).
Copyright © 1997 University of Stuttgart, Germany. $Revision: 1.3 $
Last modified: Wed Sep 24 13:54:19 EDT 1997