Program slicing provides a systematic technique to identify parts of a program relevant to a particular seed. Unfortunately, slices of modern programs often grow too large for human consumption in program understanding or browsing tools. We argue that unwieldy slices arise primarily from an overly broad definition of relevance, rather than from analysis imprecision. While a traditional slice includes all statements that may affect a value of interest, not all such statements appear equally relevant to a human.
As an improved method of finding statements relevant to a human, we propose thin slicing, a technique based on value-flow relevance. A thin slice consists of statements that may "copy-propagate" a value to the seed, and excludes statements that may indirectly affect value flow. For example, for a seed that reads a value from a container object, a thin slice includes statements that store a value into the container, but excludes statements that manipulate pointers to the container itself. We also show how a tool can support incremental thin slice expansion to explain aliasing and control dependence, yielding a traditional slice in the limit.
Experimental results show that thin slices usually include the most relevant statements for a set of debugging and program understanding tasks. Furthermore, using breadth-first inspection to simulate realistic use of a slicing tool, thin slices reveal interesting target statements after inspecting up to 4.52X fewer statements than traditional slicing for debugging tasks, and up to 34.2X fewer for program understanding tasks. Finally, experimental results show that an effective thin slicing algorithm scales well to relatively large Java benchmarks, suggesting that thin slicing represents an attractive option for practical tools.
Title
Thin Slicing
Published
2006-12-18
Full Collection Name
Electrical Engineering & Computer Sciences Technical Reports
Other Identifiers
EECS-2006-184
Type
Text
Extent
12 p
Archive
The Engineering Library
Usage Statement
Researchers may make free and open use of the UC Berkeley Library’s digitized public domain materials. However, some materials in our online collections may be protected by U.S. copyright law (Title 17, U.S.C.). Use or reproduction of materials protected by copyright beyond that allowed by fair use (Title 17, U.S.C. § 107) requires permission from the copyright owners. The use or reproduction of some materials may also be restricted by terms of University of California gift or purchase agreements, privacy and publicity rights, or trademark law. Responsibility for determining rights status and permissibility of any use or reproduction rests exclusively with the researcher. To learn more or make inquiries, please see our permissions policies (https://www.lib.berkeley.edu/about/permissions-policies).