More precise program slices could be obtained by considering the semantic r
elations between variables of interest. In this paper, we present specifica
tion-based slicing that allows a better decomposition of the program by tak
ing a specification as its slicing criterion. A specification-based slice c
onsists of a subset of program statements which preserve the behavior and t
he correctness of the original program with respect to a specification give
n by a pre-postcondition pair. Because specification-based slicing enables
one to focus attention on only those program statements which realize the f
unctional abstraction specified by the given specification. it can be widel
y used in many software engineering areas. In order to investigate its poss
ible applications, we show how specification-based slicing can improve the
process for extracting reusable functions from existing programs and restru
cturing complex programs for better maintainability. (C) 2001 Elsevier Scie
nce B.V. All rights reserved.