Slicing Object-Oriented Software

Abstract

We describe the construction of system dependence graphs for object-oriented software on which efficient slicing algorithms can be applied. We construct these system dependence graphs for individual classes, groups of interacting classes, and complete object-oriented programs. These system dependence graphs consist of a class dependence graph for each class in the system and a procedure dependence graph that represents a calling program. For an incomplete system consisting of a single class or a number of interacting classes, we construct a procedure dependence graph that simulates all possible calls to public methods in the class. For a complete system, we construct a procedure dependence graph from the main program in the system. Using these system dependence graphs, we show how to compute slices for the individual classes, groups of interacting classes or complete programs. Our slicing algorithm is based on an interprocedural slicing algorithm that utilizes graph reachability. One advantage of our approach is that the system dependence graphs can be constructed incrementally because representations of classes can be reused many times. Another advantage of our approach is that slices can be computed for incomplete object-oriented programs such as classes or class libraries. We present our results for C++, but our techniques apply to other statically typed object-oriented languages such as Ada-95.


Related research categories:
(1) Program Analysis
(2) Data Flow
(3) Slicing
(4) Object-Oriented

Go To Publications