Program slicing is a way to simplify programs based on data and control flow analysis, and has applications such as analysis, testing, debugging, and program understanding. Program slicing is also useful for reuse as it potentially allows one to ignore many statements in the process of extracting reusable component from existing software satisfying a specification. However, with conventional program slicing, the size of an extracted component could be bigger than expected, because it ignores the semantic relations between variables appearing in the specification.
In this dissertation, we propose a new slicing technique that utilizes all the information available in the specification by directly constructing slices with respect to the specification given by pre-postcondition pair, rather than constructing slices with respect to a program location and a subset of the program````s variables used in the specification. This dissertation provides the formalized notion of specification based slices and slicing rules that cover intra- and inter-procedural scopes.
Specification based slicing is a generalization of precondition based slicing and postcondition based slicing. A precondition based slice of a program identifies a subset of its statements that account for all influences of a given precondition. And a postcondition based slice consists of a subset of the statements and control predicates of a program that might affect the postcondition when the program is executed. However, precondition based slicing and postcondition based slicing are not rigorous enough to extract a reusable component since they do not produces precise slices with respect to the specification given by pre-postcondition pair. To get a more precise slice, we compose the precondition based slicing and the postcondition based slicing to use the information of precondition and postcondition at the same time.
We present an example application of the specification based slicing in extracting a r...