The process in programming whereby higher-level or abstract ideas are progressively re-expressed in terms of lower-level or concrete ones. This can involve both the implementation of procedures in terms of lower-level procedures, and also the representation of abstract data in terms of more concrete data. Both kinds of refinement can involve specifications, with each step of refinement being shown to preserve the specified behaviour of the procedure or data type being refined. Although both terms are rather fluid in meaning, there is a possible distinction to be made between refinement and program transformation, with the latter involving the replacement of one program fragment by an equivalent one at the same level of abstraction rather than its representation in terms of a lower level of abstraction.
Refinement and transformation are two of the main ideas in the increasingly important study of the systematic derivation of correct programs from specifications.