Test templates and a test template framework are introduced as useful
concepts in specification-based testing. The framework can be defined
using any model-based specification notation and used to derive tests
from model-based specifications-in this paper, it is demonstrated usin
g the Z notation. The framework formally defines test data sets and th
eir relation to the operations in a specification and to other test da
ta sets, providing structure to the testing process. Flexibility is pr
eserved, so that many testing strategies can be used. Important applic
ation areas of the framework are discussed, including refinement of te
st data, regression testing, and test oracles.