System Dependence Graphs Based on Parse Trees and their Use in Software Maintenance

Abstract The concept of static program slicing was first introduced by Weiser. Ottenstein et al. indicated that an intraprocedural slice can be found in linear time by traversing a suitable graph representation of the program referred to as the program dependence graph (PDG). Horwitz et al. introduced algorithms to construct interprocedural slices by extending the program dependence graph to a supergraph of the PDG referred to as the system dependence graph (SDG). This extension captures the calling context of procedures. In this paper, the SDG is further extended so that it handles a grammar with additional constructs. Algorithms are introduced that permit one to build the SDG so that it is based on a parse tree instead of statements. A new method is described to calculate the transitive dependences and therefore build the SDG. In addition, we demonstrate how the parse tree-based SDG can be used to provide us with “smaller” and, therefore, more precise slices and we show how slices of variables that are used in a statement can be obtained. Finally, the versatility of the SDG as an internal program representation is illustrated by briefly presenting a tool that we have developed that permits slicing, dicing, and ripple analyzing in addition to other software engineering activities to be performed on programs written in a subset of ANSI C.

[1]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[2]  Joseph Robert Horgan,et al.  Dynamic program slicing , 1990, PLDI '90.

[3]  Thomas W. Reps,et al.  Integrating non-intering versions of programs , 1988, POPL '88.

[4]  David Callahan,et al.  The program summary graph and flow-sensitive interprocedual data flow analysis , 1988, PLDI '88.

[5]  David W. Binkley,et al.  Interprocedural slicing using dependence graphs , 1990, TOPL.

[6]  Thomas W. Reps,et al.  Integrating noninterfering versions of programs , 1989, TOPL.

[7]  Wuu Yang,et al.  Detecting Program Components With Equivalent Behaviors , 1989 .

[8]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

[9]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[10]  Hareton K. N. Leung,et al.  Comments on Program Slicing , 1987, IEEE Trans. Software Eng..

[11]  Mark Weiser,et al.  Minimizing Communication for Synchronizing Parallel Dataflow Programs , 1988, International Conference on Parallel Processing.

[12]  Mark Weiser,et al.  Experiments on slicing-based debugging aids , 1986 .

[13]  Wuu Yang,et al.  The Semantics of Program Slicing , 1988 .

[14]  Mark Weiser,et al.  Programmers use slices when debugging , 1982, CACM.

[15]  Karl J. Ottenstein,et al.  The program dependence graph in a software development environment , 1984, SDE 1.

[16]  Thomas W. Reps,et al.  Illustrating interference in interfering versions of programs , 1989, SCM.

[17]  M. W. Du,et al.  Finding program slices for recursive procedures , 1988, Proceedings COMPSAC 88: The Twelfth Annual International Computer Software & Applications Conference.

[18]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[19]  John Banning,et al.  : An Efficient , 2022 .