Grade 3 · lesson 4 of 4

Test Both Sides of a Decision

Choose cases that exercise both branches and find a reversed action.

Download the grade pack

Supplied materials

  • Paper and pencil; an adult may read aloud. No device, account or purchase is needed.

Learn the idea

Testing one case can leave part of a rule untested. For if/else, choose at least one case where the condition is true and one where it is false. Write the expected output from the stated goal before tracing the draft. This separates what should happen from what the draft actually does.

Goal rule: if a card has a dot, write D; else write N. Faulty draft: if a card has a dot, write N; else write N. The supplied dot card should give D and the blank card should give N. The blank test passes, while the dot test shows the wrong true-branch action.

  1. Draw one dot card and one blank card.
  2. Write expected outputs D and N from the goal rule.
  3. Trace the faulty draft and record actual outputs N and N.
  4. Replace the true-branch N with D, then retest both cards.
Worked example

See the method in action

Before repair: dot card expected D, actual N, fail; blank card expected N, actual N, pass. After repair, the dot card gives D and the blank card gives N: both tests pass.

Your turn

Check your reasoning

Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.

Which supplied test reveals the faulty draft?

Feedback appears here after you check. This is practice, not a graded school assessment.

See the answer and explanation

The dot card should give D

Only a card with a dot reaches the incorrect true branch. A blank card exercises the already-correct else branch.

Take it further

Change the goal to triangle cards give T and all others give O. Test a triangle and a circle. Expected outputs: T and O; both branches are exercised.

Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback.

Check the subject sources

These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.