Skip to content

Test Small First

Try the tiniest example before the full homework. Two numbers before twenty. One maze corner before the whole map.

Class 9 to 10beginner15 min3 lessons
By the end you will be able to
  • Explain why tiny test cases find bugs faster
  • Pick a minimal example for a word problem
  • Describe what to do when a small test fails

Lesson 1 of 3

Shrink the problem

You would not bake a wedding cake as your first ever bake. You try cupcakes. Programs deserve the same respect.

If average-of-three fails, test average-of-two you can do in your head. If maze code fails, test a straight corridor with no branches.

Step through the animation. See a big task reduced to a five-minute check.

Continue

Lesson 2 of 3

Expected versus actual

Write what you expect beside what the program prints. Mismatch means the plan or code missed something, not that you are bad at computing.

Teachers call these test cases. You can write them before code exists.

Maze lab backtracking is easier when you test dead ends on a three-cell map first.

Continue

Lesson 3 of 3

Then plan on paper

Small tests feed into the plan-before-code capstone next. You will reorder steps with proof from tiny examples.

Keep a notebook of tests that caught bugs. Future you will thank present you.

Quality beats speed when you are still learning how to test and plan.

Continue

Practice

Work these out yourself

No answer key here on purpose: these are the questions worth thinking through before you move on. Open one and work it out.

0/3 attempted

Assessment

Check your understanding

Answer each question, then read the explanation. That is where the learning is.

0/4
  1. Question 1: Testing small first helps mainly because what?
    Question 1 / 4

    Testing small first helps mainly because what?

    Select an option first
  2. Question 2: Expected 10, actual 9 means what?
    Question 2 / 4

    Expected 10, actual 9 means what?

    Select an option first
  3. Question 3: A test case can be written when?
    Question 3 / 4

    A test case can be written when?

    Select an option first
  4. Question 4: Two-score average before thirty-score average is an example of what?
    Question 4 / 4

    Two-score average before thirty-score average is an example of what?

    Select an option first
4 of 4 questions left.

Finished this topic?

0 of 3 lessons marked done. Marking the topic complete ticks the rest.