lesson

Test boundaries and failure paths

1 · Learn

A useful test specifies an input, expected result and actual result. Boundary tests probe the edges of permitted ranges. Invalid tests check whether bad input is rejected safely rather than silently accepted or causing a crash.

For ages permitted from 12 through 16 inclusive, test 11, 12, 16 and 17 as well as an ordinary valid value. Do not change the expected result after seeing the program's output merely to make the test pass.

InputExpectedActualPass or fail
Key words and supplied examples.

2 · Worked example

12 and 16 should be accepted by the stated range, while 11 and 17 should be rejected.

3 · Your turn

Under that rule, should age 16 be accepted? Which nearby value tests just outside the upper boundary?

Check your answer

16 is accepted; 17 is just outside and should be rejected.

4 · Apply your learning

Create a test table before implementation and record a discovered defect with its smallest reproducing input.

Adult guidance and safety

Use an approved sandbox with invented data. Never ask for real passwords, personal records or access to another person's system. These text examples need executable projects and assessed evidence in two languages; reading code alone is not practical mastery.

Open your writing and drawing pad

Write, draw or show your working. Use a mouse, pen or finger. This pad is not a submitted answer.

Not saved to your account. Download your drawing as PNG and your typed notes as TXT before leaving or refreshing. They are separate files. Do not enter private information.

Open a picture saved on this device to draw on it again. Opening replaces the drawing, but Undo can restore it. PNG only, up to 4 MB and 4096 × 4096 pixels. The picture stays in this browser; it is not uploaded. Paper lines in a saved picture become part of that picture.

Drawing is unavailable. Use the typed working area below.

Your pad is empty.

Open a UTF-8 TXT file from this device, up to 40 KB and 10,000 characters. It stays in this browser. Opening can be undone until you type again. Downloads keep a new copy; they do not change the file you opened.

Typed notes are not submitted answers.

Check a calculation · Year 5 onward

Use this only when your teacher or adult allows a calculator for the task. Show your thinking first. It does not replace mental or written arithmetic and does not mark your lesson answer.

Powers, roots and trigonometry · Year 7 onward

Use only when the task allows a calculator. Choose one operation at a time and record your working. Trigonometry here always uses degrees (DEG), not radians. Inverse sine, cosine and tangent return an angle, not a reciprocal. Keep exact fractions and π in answers when requested.

Approximate numerical results use up to 12 significant digits. Inverse sine returns −90° to 90°, inverse cosine 0° to 180°, and inverse tangent −90° to 90°; these are principal values, not every possible solution of a trigonometric equation.

Practice this lesson

Lesson resources

Browse the available practice activities and worksheets for this lesson.

Open course resources

Your progress

Ready to continue?