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
| Word | What it means |
|---|---|
| Test data | the values you feed into a test |
| Valid | data the rules say should be accepted |
| Invalid | the right kind of data, but outside the rules |
| Boundary data | a value at the edge of what is allowed, and just beside it |
| Erroneous data | the wrong kind of data altogether |
| Expected result | what should happen for that data |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsYour 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 data | Kind | Expected result |
|---|---|---|
| 7 | Valid | Accepted |
| 1 | Boundary (valid) | Accepted |
| 14 | Boundary (valid) | Accepted |
| 0 | Boundary (invalid) | Refused |
| 15 | Boundary (invalid) | Refused |
| 30 | Invalid | Refused |
| abc | Erroneous | Refused with a message |
The cells students fill in are left blank in this preview.
Check
Have a go
Check
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.