The shape of the lesson
By the end of the lesson, learners can
- Four kinds of test data: In the lab's test data mode, pick values for each category and run the validation routine.
- Choosing test data for a scenario: In the exam you are given a rule and asked to suggest test data of a stated type, with a reason.
- A test plan: Testers write the expected result before running each test, then compare it with the actual result.
- Normal: typical, accepted.
- Abnormal: out of range or wrong type, rejected.
- Extreme: the smallest or largest accepted value.
- Boundary: the last accepted value and the first rejected value at a limit.
One picture every idea returns to
Normal data is typical data that should be accepted. Abnormal (erroneous) data should be rejected: out of range or the wrong type. Extreme data is the largest or smallest acceptable value. Boundary data is the largest or smallest acceptable value and the corresponding smallest or largest rejected value, testing both sides of each limit. Each test has an expected result.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Test the edges.. A program that works for one sensible value might still fail at the edges of what it should accept, or crash on something silly. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: Four kinds of test data | In the lab's test data mode, pick values for each category and run the validation routine. Project tab 3 of the lab (Test data for a validation routine) and let a student drive it while the class predicts. | Whole class, then pairs |
| 13 to 21 min | Teach and check: Choosing test data for a scenario | In the exam you are given a rule and asked to suggest test data of a stated type, with a reason. Model the worked example A percentage on the board, one line at a time. Your turn: A car park accepts stays of 1 to 24 whole hours. Give the boundary test data for the upper limit, with the expected results. | Pairs |
| 21 to 30 min | Teach and check: A test plan | Testers write the expected result before running each test, then compare it with the actual result. Your turn: The line UNTIL Age >= 11 AND Age <= 18 is mistyped as UNTIL Age > 11 AND Age <= 18. Which test in the plan reveals the error? | Think-Pair-Share |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 17 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in A test plan, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Think-Pair-Share
Pose the question, give thirty seconds of silent thinking, then a minute to compare with a partner before a few pairs share with the class. The silent minute is the part that cannot be cut.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| Extreme data is always accepted: it is the very edge of what is allowed. | Boundary data comes in pairs, one accepted and one rejected, at each limit. |
| Read "more than 10" carefully: 10 itself is rejected, so the smallest acceptable whole number is 11. | The boundary pair is then 10 (rejected) and 11 (accepted). |
| An expected result must be specific: "rejected, error message shown" or "accepted", not just "it works". | Return to A test plan: ask a pair to state the correct version and show it on the lab before moving on. |
Normal, abnormal, extreme and boundary test data: worksheet
6 questions, 17 marks. Written in the style of the papers; no past paper question is reproduced.
State the purpose of each type of test data: normal, abnormal, extreme and boundary.
A program accepts the number of pupils on a school trip, from 5 to 40 inclusive. Give one item of normal, abnormal and extreme test data, and one boundary pair, with the expected result for each.
Explain the difference between extreme test data and boundary test data.
A program should accept heights from 100 to 220 cm. It is tested with 150, 180 and 200 only. Explain why this testing is not enough, and suggest three more items of test data.
A password must have from 8 to 16 characters. Give boundary test data for the lower limit and the expected results.
This check is meant to accept scores from 0 to 10 inclusive: IF Score > 0 AND Score < 10 THEN OUTPUT "Valid". Identify the test data that would show it is wrong and correct the condition.
Answer key and marking notes
- Normal: to check typical data is accepted and processed correctly.
- Abnormal: to check data that should be rejected is rejected.
- Extreme: to check the largest and smallest acceptable values are accepted.
- Boundary: to check each limit, the last accepted value is accepted and the first value beyond it is rejected.
- Normal: e.g. 20, accepted.
- Abnormal: e.g. 75 or "ten", rejected.
- Extreme: 5 or 40, accepted.
- Boundary: 40 accepted and 41 rejected (or 5 accepted and 4 rejected).
- Extreme data is only the largest/smallest acceptable value, which should be accepted.
- Boundary data also includes the matching value just outside the limit, which should be rejected.
- All three are normal data, so the limits and invalid data are not tested.
- Add extreme / boundary data, e.g. 100 and 220 (accepted), 99 and 221 (rejected).
- Add abnormal data, e.g. -50 or "tall" (rejected). (Any three suitable values.)
- A password of 8 characters: accepted.
- A password of 7 characters: rejected.
- Testing the extreme values 0 and 10 shows they are wrongly rejected.
- Correct condition: Score >= 0 AND Score <= 10.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
A program accepts whole numbers from 20 to 60 inclusive. Which pair is boundary data for the lower limit?
- A19 and 20
- B20 and 21
- C20 and 60
- D19 and 61
A quiz score must be a whole number from 0 to 25 inclusive. The value 25 is used as test data. What type of test data is it, and what is the expected result?
- AExtreme: accepted
- BAbnormal: rejected
- CNormal: accepted
- DBoundary: rejected
A field accepts the number of guests as a whole number from 1 to 50. The tester enters the text twelve. What type of test data is this, and what is the expected result?
- AAbnormal: rejected
- BNormal: accepted
- CExtreme: accepted
- DBoundary: rejected
A program accepts whole numbers more than 5 and less than 50. Which value is extreme test data?
- A6
- B5
- C50
- D25
A parcel weight should be accepted if it is from 1 to 30 kg inclusive, but the programmer writes UNTIL Weight > 1 AND Weight <= 30. Which test value shows that the check is wrong?
- A1
- B30
- C15
- D31
A password must be from 6 to 12 characters long. Which set of password lengths is boundary data for both limits?
- A5, 6, 12 and 13 characters
- B6 and 12 characters
- C6, 7, 11 and 12 characters
- D1, 6, 12 and 20 characters
Quiz key
At the lower limit, 20 is the smallest accepted value and 19 the largest rejected value next to it, so 19 and 20 test both sides. 20 and 21 are both accepted, so the rejected side is never tested. 20 and 60 are the two extreme values. 19 and 61 are both rejected values, one at each end.
25 is the largest acceptable value, so it is extreme data and should be accepted. It is inside the range, so it is not abnormal and should not be rejected. It is at the limit rather than a typical middle value, so it is not best described as normal. It is the accepted half of a boundary pair, so "boundary: rejected" gives the wrong expected result (26 would be rejected).
Text in a whole-number field is the wrong data type, so it is abnormal (erroneous) data and should be rejected. Reading it as 12 and calling it normal ignores the type. Extreme data is the smallest or largest accepted number. Boundary data is a value at a numeric limit, such as 50 and 51.
More than 5 means 5 is rejected, so the smallest accepted whole number is 6, which is extreme data (49 at the top is the other one). 5 and 50 are both rejected, so they are boundary values on the rejected side, not extreme. 25 is a typical value in the middle: normal data.
1 should be accepted, but 1 > 1 is false, so the faulty check rejects it: the actual result differs from the expected one. 30 satisfies <= 30 and is correctly accepted, 15 is correctly accepted and 31 is correctly rejected, so none of these reveals the error. This is why extreme and boundary data are tested, not just normal data.
At the lower limit 6 is accepted and 5 rejected; at the upper limit 12 is accepted and 13 rejected. 6 and 12 alone are extreme data, with no rejected side tested. 6, 7, 11 and 12 are all accepted. 1 and 20 are rejected, but they are far from the limits, so an off-by-one error such as <= 13 written instead of <= 12 would be missed.
What to project
The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.