Program slicing techniques and its applications
Program understanding is an important aspect in Software Maintenance and Reengineering. Understanding the program is related to execution behaviour and relationship of variable involved in the program. The task of finding all statements in a program that directly or indirectly influence the value for an occurrence of a variable gives the set of statements that can affect the value of a variable at some point in a program is called a program slice. Program slicing is a technique for extracting parts of computer programs by tracing the programs’ control and data flow related to some data item. This technique is applicable in various areas such as debugging, program comprehension and understanding, program integration, cohesion measurement, re-engineering, maintenance, testing where it is useful to be able to focus on relevant parts of large programs. This paper focuses on the various slicing techniques (not limited to) like static slicing, quasi static slicing, dynamic slicing and conditional slicing. This paper also includes various methods in performing the slicing like forward slicing, backward slicing, syntactic slicing and semantic slicing. The slicing of a program is carried out using Java which is a object oriented programming language.
💡 Research Summary
The paper provides a comprehensive survey of program slicing techniques and their practical applications. It begins by emphasizing the importance of program understanding in software maintenance and reengineering, and defines a program slice as the set of statements that directly or indirectly affect the value of a variable at a particular program point. The authors review the historical origin of slicing (Weiser) and then categorize the main slicing approaches: static slicing, dynamic slicing, simultaneous dynamic slicing, and quasi‑static (conditioned) slicing.
Static slicing is described in terms of constructing a Program Dependence Graph (PDG) that captures both data and control dependencies. By performing a backward traversal from a slicing criterion <statement, variable>, the algorithm extracts all statements that may influence the criterion. The paper distinguishes forward and backward static slices, illustrating how backward slices help locate bugs and forward slices predict the impact of changes.
Dynamic slicing refines this by incorporating a concrete execution trace. The slicing criterion is expressed as a triple (input, statement occurrence, variable), and only statements that actually affect the variable during that execution are retained. This yields more precise slices, especially for arrays and pointers, because each element is treated individually. An example program demonstrates how the dynamic slice excludes branches that were never taken.
Simultaneous dynamic slicing extends dynamic slicing to a set of test cases. Rather than simply unioning individual dynamic slices (which can be unsound), the authors present an iterative algorithm that incrementally enlarges a slice until it is correct for all inputs in the test suite. This technique is valuable for test‑driven program comprehension and function localization.
Quasi‑static slicing is presented as a hybrid of static and dynamic methods. Certain variables are fixed to specific values (conditions) while others remain variable, allowing the slice to reflect a particular execution scenario without losing the generality of static analysis. The paper notes the lack of a formal algorithm for this approach but highlights its usefulness for conditioned program understanding.
The authors also differentiate syntactic (based purely on program structure) from semantic slicing (which considers actual runtime semantics), discussing the trade‑off between analysis cost and precision. Various output forms—extracted source code, dependence graphs, execution trees—are described, showing how slices can be visualized for debugging, refactoring, cohesion measurement, and reengineering tasks.
Implementation details are provided using Java. The paper explains how to build PDGs for object‑oriented code, handle inter‑procedural dependencies, and generate slices for sample Java programs. Through concrete examples, the authors demonstrate bug localization via backward slices, impact analysis via forward slices, and the reduction of code for specific test scenarios using simultaneous dynamic slicing.
Overall, the paper systematically presents the theoretical foundations, algorithmic strategies, and practical implications of multiple slicing techniques, making it a valuable reference for researchers and software engineers seeking to apply slicing for program comprehension, debugging, testing, and maintenance.
Comments & Academic Discussion
Loading comments...
Leave a Comment