Program slicing is an automatic program abstraction technique whose many ap
plications include software maintenance, re-engineering and comprehension,
all of which rely crucially upon the precision of the slicing algorithm use
d. When slicing is applied to maintenance problems, the programs to be slic
ed are typically legacy systems, often written in older, 'unstructured' pro
gramming styles. For slicing to be a useful tool to the software maintainer
it is therefore important to have precise algorithms for slicing unstructu
red programs.
Unfortunately the standard algorithms for slicing structured programs do no
t extend correctly to the unstructured paradigm, and currently proposed mod
ifications to these standard algorithms produce either unnecessarily large
slices or slices which are not true subsets of the original program from wh
ich they are constructed.
This paper introduces a modification of Agrawal's algorithm for slicing uns
tructured programs, which overcomes these difficulties. The new algorithm p
roduces thinner slices than any previously published algorithm while respec
ting both the semantic and syntactic constraints of slicing, (C) 1998 John
Wiley & Sons, Ltd.