Program slicing

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 in debugging to locate more easily source of errors. Other applications of slicing include software maintenance, optimization, and program 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 and Janusz 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

int i;int sum = 0;int product = 1;for(i = 0; i < N; ++i) { sum = sum + i; product = product *i;}write(sum);write(product);This new program is a valid slicing of the above program with respect to the criterion (write(sum),{sum}):int i;int sum = 0;

for(i = 0; i < N; ++i) { sum = sum + i;

}write(sum);

In fact, most static slicing techniques, including Weiser's own technique, will also remove the write(sum) statement. Indeed, at the statement write(sum), the value of sum 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&ndash;449, IEEE Computer Society Press, March 1981.

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.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Program Slicing — Unter Slicing (genauer Program Slicing) versteht man die Analyse eines Computerprogramms mit dem Ziel herauszufinden, welche Anweisungen eines Programms eine bestimmte Anweisung in einem bestimmten Programmpunkt beeinflussen bzw. von ihr… …   Deutsch Wikipedia

  • Slicing — may refer to: * Slicing, the mechanical process, see Cutting * Slicing (web design), a web design technique * Program slicing, a set of software engineering methods * Object slicing, an object oriented programming technique * Array slicing, an… …   Wikipedia

  • Slicing — steht für: Program Slicing, eine Analyse für Computerprogramme Slicen, ein Verfahren im Screen und Webdesign Array Slicing, eine Operation in Programmiersprachen Diese Seite ist eine Begriffsklärung zur Untersche …   Deutsch Wikipedia

  • Program analysis — For other uses, see Program analysis (disambiguation). In computer science, program analysis is the process of automatically analysing the behavior of computer programs. Two main approaches in program analysis are static program analysis and… …   Wikipedia

  • Array slicing — In computer programming, array slicing is an operation that extracts certain elements from an array and packages them as another array, possibly with different number of indices (or dimensions) and different index ranges. Two common examples are… …   Wikipedia

  • ReCycle (program) — ReCycle is a music loop editor designed and developed by Swedish software developers Propellerhead Software. It runs on Microsoft Windows and Apple Macintosh based PCs. The software debuted in 1994.The principal idea of ReCycle is to alter the… …   Wikipedia

  • Frameworks supporting the polyhedral model — Use of the polyhedral model within a compiler requires software to represent the objects of this framework (sets of integer valued points in regions of various spaces) and perform operations upon them (e.g., testing whether the set is empty). Two …   Wikipedia

  • Aspect-oriented software development — (AOSD) is an emerging software development technology that seeks new modularizations of software systems. AOSD allows multiple concerns to be expressed separately and automatically unified into working systems.Traditional software development has …   Wikipedia

  • Mark Harman (computer scientist) — For other people named Mark Harman, see Mark Harman (disambiguation). Mark Harman is a British computer scientist. Since 2004 he has been a Professor at King s College London,[1] where he leads the Software Engineering Group.[2] He is also… …   Wikipedia

  • GXL — (Graph eXchange Language) is designed to be a standard exchange format for graphs. GXL is an XML sublanguage and the syntax is given by an XML DTD (Document Type Definition). This exchange format offers an adaptable and flexible means to support… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”