- Program slicing
In
computer programming , program slicing is the computation of a program slice. The program slice consists of the parts of a program that may affect the values computed at some point of interest, referred as a slicing criterion. Program slicing can be used indebugging to locate more easily source of errors. Other applications of slicing includesoftware maintenance , optimization, andprogram analysis .Slicing techniques has been knowing a rapid development since the original definition of
Mark Weiser . At first, the slicing was only static, i.e. applied on the source code with no other information than the source code.Bogdan Korel andJanusz Laski introduced "dynamic slicing" which works on a specific execution of the program (for a given execution trace). Other forms of slicing exist, for instance path slicing.Static slicing
Based on the original definition of Weiser, informally, a static program slice S consists of all statements in program P that may affect the value of variable v at some point p. The slice is defined for a slicing criterion C=(x,V), where x is a statement in program P and V is a subset of variables in P. A static slicing includes all the statements that affect variable v for a set of all possible inputs at the point of interest (i.e. at the statement x). Static slices are computed by finding consecutive sets of indirectly relevant statements, according to data and control dependencies.
Example
This new program is a valid slicing of the above program with respect to the criterion (
write(sum)
,{sum}):In fact, most static slicing techniques, including Weiser's own technique, will also remove thewrite(sum)
statement. Indeed, at the statementwrite(sum)
, the value ofsum
is not dependent of the statement itself.ee also
*
Software maintenance
*Reaching definition
*Data dependency References
*
Mark Weiser . "Program slicing". "Proceedings of the 5th International Conference on Software Engineering", pages 439–449,IEEE Computer Society Press, March1981 .External links
* [http://indus.projects.cis.ksu.edu/index.shtml Indus Project]
* [http://bandera.projects.cis.ksu.edu/index.shtml Bandera Project]
* [http://www.cs.wisc.edu/wpis/html/ Wisconsin Program-Slicing Project]
Wikimedia Foundation. 2010.