Slicing techniques can provide solutions to many software engineering problems such as testing, program understanding and extraction of a reusable component. However, current slicing criteria and the corresponding techniques might obtain slices that contain unnecessary statements in some situations. In this paper, we propose a new slicing technique that takes the specification of the slice into account. The information present in the specification helps to produce more precise slices by removing statements that are not relevant to the specification for the slice. Our technique is based on the weakest precondition and strongest postcondition. We present an example of applying the proposed technique in extracting a reusable component from an existing program.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.