Understand the idea
A useful test suite includes normal, boundary and invalid cases with expected outputs. Passing a few tests does not prove the absence of bugs.
WORKED EXAMPLE
For a count validator accepting whole numbers 0-20, test 7 (valid), 0 and 20 (boundaries), and 21 or 2.5 (invalid).
Watch it step by step
Step 1 of 4Specify
Write the whole-number 0-20 rule.
Choose Play to advance steps automatically.
Read or choose any step
- Specify
Write the whole-number 0-20 rule.
- Normal
7 should be accepted.
- Boundary
0 and 20 should be accepted.
- Invalid
21 and 2.5 should be rejected.
TRY BEFORE CHECKING
Exercises with feedback
MAKE SOMETHING YOU CAN EXPLAIN
Your practical challenge
Create a test table for the validator with expected and observed outputs, marking unrun tests clearly.
These ticks are your self-review. They do not automatically assess project quality. Ask an adult or partner to review what you can show.
Use the skill in a new situation
Add a test for missing input.