Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

SC 2.5: Choosing test data

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

55 minutes

The form that accepted minus five

A school lets students borrow a laptop for 1 to 14 days. A student types -5. The form says, "Loan booked."

The builder had only tried the number 7. Good test data (the values you try) would have caught it in a minute.

By the end of this lesson

Note

I can create valid, invalid, boundary and erroneous test data for a rule.

Key words

WordWhat it means
Test datathe values you feed into a test
Validdata the rules say should be accepted
Invalidthe right kind of data, but outside the rules
Boundary dataa value at the edge of what is allowed, and just beside it
Erroneous datathe wrong kind of data altogether
Expected resultwhat should happen for that data

The cells students fill in are left blank in this preview.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Four kinds of test data

The rule is: a loan is a whole number of days from 1 to 14.

Valid data follows the rule, such as 7. The form should accept it.

Invalid data is the right kind but breaks the rule, such as 30 or -5. The form should refuse it.

Erroneous data is the wrong kind, such as "abc" or nothing at all. The form should refuse it, with a clear message.

Boundary data sits at the edges

Boundary data goes at the edge of the rule and just beside it. For 1 to 14, test 0, 1, 14 and 15.

Builders often get the edge wrong by one. They write "more than 1" when they meant "1 or more". Edge tests find that.

Worked example: days from 1 to 14

Test dataKindExpected result
7ValidAccepted
1Boundary (valid)Accepted
14Boundary (valid)Accepted
0Boundary (invalid)Refused
15Boundary (invalid)Refused
30InvalidRefused
abcErroneousRefused with a message

The cells students fill in are left blank in this preview.

Check

Have a go

Check

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

5 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.