Skip to the page
Year 9 · Summer 2 · Raid: Capstone

Testing against success criteria

PracticalPresent ▶

What this lesson covers

Topic 14 Programming further

KS3 Computing · Real programs keep data in lists, take text apart as strings, split work into subroutines, check their input, save to files, and get tested on purpose.

Programming Computational ThinkingCambridge Lower Secondary Computing 0860

You will learn to

  • Write a test table with at least one test for each success criterion.
  • Choose normal, boundary and erroneous test data, and write the expected result before testing.
  • Use another guild's test run to find failures.
  • Fix what fails, and run the failed tests again.

Success criteria

  • I can write input, expected, actual and pass or fail for every test.
  • I can pick boundary data for a range, like 0, 255, -1 and 256.
  • I can show a test that failed, the fix, and the same test passing.

Key words

Say each word, then read what it means. Every one is in the glossary too.

Boundary
Test data at the very edge of what's allowed.
List
One name holding many values in order. Also called an array.
Index
An item's position in a list, counting from 0.
Subroutine
A named block of code you can call when needed.
Function
A subroutine that returns a value.
Parameter
A placeholder in a subroutine for a value passed in.
Validation
Checking input is reasonable before using it.
Boundary data
Test data at the very edge of what's allowed.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Testing

For a program that accepts a score from 0 to 50:

Test dataMeaningExamplesExpected
NormalSensible data23, 38Accepted
BoundaryAt the very edges0, 50 (and -1, 51)0 and 50 accepted; -1, 51 rejected
ErroneousWrong type or nonsense"hello", 3.7, blankRejected with a message
★Remember

A test plan is written before testing: what you'll test, the data, the expected result.

Study it

Open the study page and go one step at a time.

The steps for this lesson

Try it

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.