Stepwise refinement
A procedure for developing a program incrementally, proposed by Niklaus Wirth in Program development by stepwise refinement.
- Describe a high-level procedure for solving the problem in terms of subtasks, then repeatedly refine each subtask step by step.
- Rather than using a programming language directly from the start, describe the procedure in the language most natural for the problem at hand.
- At each step of refining a task into subtasks, make design decisions based on computational efficiency, memory efficiency, code clarity, structural regularity, and so on. It is important to practice consciously reviewing each decision. If an earlier decision proves wrong, go back—even all the way to the beginning.