A specification provides a concise description of a system, and can be used as both the benchmark against which any implementation is tested, and also as a means to generate tests. Formal specifications have potential advantages over informal descriptions because they offer the possibility of reducing the costs of testing by automating part of the testing process. This observation has led to considerable interest in developing test generation techniques from formal specifications, and a number of different methods have been derived for state‐based formalisms such as Z, B and VDM. However, after tests have been derived from a formal specification, the specification might be refined further before it is implemented, and therefore a mechanism is needed to relate the abstract tests to the refined implementation.
The purpose of this paper is to provide such a method by exploring the relationship between testing and refinement. In this paper a model for test generation is used which constructs a finite state machine (FSM) from a Z specification by using a Disjunctive Normal Form (DNF) partition analysis of the state and operations. The finite state machine is then used to derive suitable test suites. The paper decribes a way of calculating an FSM for a refinement from an abstract FSM together with the information about the refinement embodied in the retrieve relation. This means that it is possible to test an implementation by generating a new concrete finite state machine from a set of abstract tests. Copyright © 1999 John Wiley & Sons, Ltd.