This Article 
 Bibliographic References 
 Add to: 
Computation of Dynamic Program Slices for Unstructured Programs
January 1997 (vol. 23 no. 1)
pp. 17-34

Abstract—A dynamic program slice is an executable part of the program whose behavior is identical, for the same program input, to that of the original program with respect to a variable(s) of interest at some execution position. The existing algorithms of dynamic slice computation use data and control dependencies to compute dynamic slices. These algorithms are limited to structured programs because, as we will show, they may compute incorrect dynamic slices for unstructured programs due to the limitations of control dependencies that are used to compute dynamic slices. In this paper we present a novel approach of dynamic slice computation for unstructured programs. The approach employs the notion of a removable block in finding dynamic program slices. Dynamic slices are derived by identifying not only these parts of program execution that contribute to the computation of the value of a variable of interest, but also these parts of program execution that do not contribute to the computation of the variable value. Data dependencies are used to identify contributing computations, whereas removable blocks are used to identify noncontributing computations. We have proven that the presented dynamic slicing algorithms compute correctly dynamic slices. In addition, these algorithms may compute more accurate dynamic slices as opposed to the existing algorithms that use control dependencies. The presented algorithms have been implemented in a dynamic slicing tool that supports dynamic slicing for Pascal programs.

[1] H. Agrawal and J.R. Horgan, "Dynamic Program Slicing," Proc. ACM SIGPLAN '90 Conf. Programming Language Design and Implementation, pp. 246-256, June 1990.
[2] H. Agrawal, R. DeMillo, and E. Spafford, "Debugging with Dynamic Slicing and Backtracking," Software Practice Experience, vol. 23, no. 6, pp. 589-616, 1993.
[3] H. Agrawal, “On Slicing Programs with Jump Statements,” Proc. ACM SIGPLAN '94 Conf. Programming Language Design and Implementation, pp. 302–312, June 1994.
[4] R. Balzer, "Exdams: Extendible Debugging and Monitoring System," Proc. Spring Joint Computer Conf., pp. 567-580,Reston, Va.: AFIPS Press, 1969.
[5] T. Ball and S. Horwitz, “Slicing Programs with Arbitrary Control Flow,” Proc. First Int'l Workshop Automated and Algorithmic Debugging, pp. 206–222, Nov. 1993.
[6] J. Cheng, "Slicing Concurrent Programs," Proc. First Int'l Workshop Automated and Algorithmic Debugging,Linkoping, Sweden, pp. 244-261, 1993.
[7] J. Choi, B. Miller, and R. Netzer, "Techniques for Debugging Parallel Programs with Flow Back Analysis," ACM Trans Programming Languages and Systems, vol. 13, no. 4, pp. 491-530, Oct. 1991.
[8] E. Duesterwald, R. Gupta, and M.L. Soffa, "Distributed Slicing and Partial Re-execution for Distributed Programs," Proc. Fifth Workshop Languages and Compilers for Parallel Computing, pp. 329-337, 1992.
[9] J. Ferrante,K.J. Ottenstein,, and J.D. Warren,“The program dependence graph and its use in optimization,” ACM Trans. Programming Languages and Systems, vol. 9, no. 3, pp. 319-349, June 1987.
[10] K. Gallagher and J. Lyle, “Using Program Slicing in Software Maintenance,” IEEE Trans. Software Eng., Aug. 1991, pp. 751-761.
[11] R. Gopal, "Dynamic Program Slicing Based on Dependence Relations," Proc. Conf. Software Maintenance, pp. 191-200,Sorrento, Italy, 1991.
[12] R. Gupta, M.J. Harrold, and M.L. Soffa, “An Approach to Regression Testing Using Slicing,” Proc. Conf. Software Maintenance—1992, pp. 299-308, Nov. 1992.
[13] S. Horwitz, T. Reps, and D. Binkley, “Interprocedural Slicing Using Dependence Graphs,” ACM Trans. Programming Languages and Systems. vol. 12, no. 1, pp. 26-60, Jan. 1990.
[14] M. Kamkar, "Interprocedural Dynamic Slicing with Applications to Debugging and Testing," PhD thesis, Linkoping Univ., 1993.
[15] M. Kamkar, P. Fritzson, and N. Shahmehri, Interprocedural Dynamic Slicing Applied to Interprocedural Data Flow Testing Proc. Int'l Conf. Software Maintenance, pp. 386-395, Sept. 1993.
[16] B. Korel and J. Laski, "Dynamic Program Slicing," Information Processing Letters, vol. 29, no. 3, Oct. pp. 155-163, 1988.
[17] B. Korel and J. Laski, "Dynamic Slicing in Computer Programs," The J. of Systems and Software, vol. 13, no. 3, pp. 187-195, 1990.
[18] B. Korel and R. Ferguson, "Dynamic Slicing of Distributed Programs," Applied Mathematics Computer Science J., vol. 2, no. 2, pp. 199-215, 1992.
[19] B. Korel, "Identifying Faulty Modifications in Software Maintenance," Proc. First Int'l Workshop Automated and Algorithmic Debugging, pp. 341-356,Linkoping, Sweden, 1993.
[20] B. Korel and S. Yalamanchili, "Forward Derivation of Dynamic Slices," Proc. Int'l Symp. Software Testing and Analysis,Seattle, pp. 66-79, 1994.
[21] J. Lyle and M. Weiser, "Experiments on Slicing-Based Debugging Tools," Proc. First Conf. Empirical Studies of Programming, pp. 187-197, June 1986,.
[22] M. Weiser, “Programmers Use Slices when Debugging,” Comm. ACM, vol. 25, no. 7, pp. 446-452, 1982.
[23] M. Weiser, "Program Slicing," IEEE Trans. Software Eng., vol. 10, no. 4, pp. 352-357, July 1982.
[24] L. White and H. Leung, "Regression Testability," IEEE Micro, pp. 81-85, Apr. 1992.

Index Terms:
Program slicing, dynamic program slicing, removable block, control dependence, data dependence, execution trace, unstructured program, debugging.
Bogdan Korel, "Computation of Dynamic Program Slices for Unstructured Programs," IEEE Transactions on Software Engineering, vol. 23, no. 1, pp. 17-34, Jan. 1997, doi:10.1109/32.581327
Usage of this product signifies your acceptance of the Terms of Use.