Program slices are useful in debugging, testing, maintenance, and understanding of programs. The conventional notion of a program slice, the
static slice
, is the set of all statements that
might
affect the value of a given variable occurrence. In this paper, we investigate the concept of the
dynamic slice
consisting of all statements that
actually
affect the value of a variable occurrence for a given program input. The sensitivity of dynamic slicing to particular program inputs makes it more useful in program debugging and testing than static slicing. Several approaches for computing dynamic slices are examined. The notion of a Dynamic Dependence Graph and its use in computing dynamic slices is discussed. The Dynamic Dependence Graph may be unbounded in length; therefore, we introduce the economical concept of a Reduced Dynamic Dependence Graph, which is proportional in size to the number of dynamic slices arising during the program execution.
Programmers spend considerable time debugging code. Symbolic debuggers provide some help but the task remains complex and difficult. Other than breakpoints and tracing, these tools provide little highlevel help. Programmers must perform many tasks manually that the tools could perform automatically, such as finding which statements in the program affect the value of an output variable for a given test case, and what was the value of a given variable when the control last reached a given program location. If debugging tools provided explicit support for these tasks, the debugging process could be automated to a significant extent.In this paper we present a debugging model, based on dynamic program slicing and execution backtracking techniques, that easily lends itself to automation. This model is based on experience with using these techniques to debug soflware. We also present a prototype debugging tool, SPYDER, that explicitly supports the proposed model, and with which we are performing further debugging research. * The figures are X Window System window dumps of our prototype debugging tool, SPYDER, in operation. t A test case consists of a specific set of run-time input values. $ We will refer to this test case as the test case no. 1 in later sections. DEBUGGING WITH DYNAMIC SLICING AND BACKTRACKING :b", i + l ) t 1 doppsd at. l l m 43. > c l s s > clear > dyaric prop.= slice m "areaat lim 43 Currat Teatcsw It: 1 * 591 Figure 1. Dynamic program slice with respect to area on line 43 during the second loop iteration for test case no. I H . AGRAWAL, R. A. DEMILLO AND E. H. SI'AFFORD * SPYDER indicates the next statement to be executed by an arrow in the left margin of the code window. See, e.g., Figure 4.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.