Keywords:
Situation:
You have code to write. You'll need to test it.
Actions:
Test each chunk of code after you've written it. Write some, test it, write some, test it. Don't wait until you've written all of the code.
Explanation:
Code you write later depends on code you wrote earlier. For example, suppose you had code with an input step, a processing step, and an output step.
The output code depends on the processing code being right. The processing code depends on the input code.
Suppose you wait until you've written all the code before you test it. An error in the input code can force you to rewrite the rest of the program.
But if you test the input code and fix the bug before you write the rest of the program, you won't have to go back and rewrite anything. You'll save time.