More precise program slices could be obtained by considering the semantic relations between variables of interest. In this paper, we present specification-based slicing that allows a better decomposition of the program by taking a specification as its slicing criterion. A specification-based slice consists of a subset of program statements which preserve the behavior and the correctness of the original program with respect to a specification given by a pre-postcondition pair. Because specification-based slicing enables one to focus attention on only those program statements which realize the functional abstraction specified by the given specification. it can be widely used in many software engineering areas. In order to investigate its possible applications, we show how specification-based slicing can improve the process for extracting reusable functions from existing programs and restructuring complex programs for better maintainability. (C) 2001 Elsevier Science B.V. All rights reserved.