| ![]() |
Program Slicing: An Application of
Object-oriented Program Dependency Graphs
Anand Krishnaswamy
Dept. of Computer Science
Clemson University
Clemson, SC 29634-1906
[email protected]
Abstract
A considerable amount of work has been done in the area of representing programs with single and multiple procedure bodies. A complete study of the latter requires both intra and interprocedural analysis. In the analysis of an object-oriented program, it is all the more important due to the existence of numerous classes and methods within the classes.
Object-oriented design is based on the philosophy of data encapsulation and controlled access to the encapsulated data. There are different representations available for object-oriented design. These representations do not give a complete picture of the programs thus restricting code analysis and preventing many testing techniques from using them. This paper discusses the issues involved in representing object-oriented programs. A representation based on the Program Dependency Graphs is designed. Different concepts of the paradigm are represented, including polymorphism, dynamic binding and the class inheritance hierarchy. Message exchanges between objects are also discussed and a more compact manner of representing parameter flow is presented.
A second issue addressed in this paper is that of slicing in object-oriented programs. Determining an object-oriented slice is more complex than determining either an intraprocedural or interprocedural slice. It has been shown that Program Dependency Graphs are well suited for slicing procedural programs. A high level pseudocode algorithm is given, that demonstrates the applicability of the Object-oriented Program Dependency Graph for slicing object-oriented programs. Other applications based on this representation are also introduced.