Study Guide Instructor view
Choosing Test Data
Teaching notes for Lesson 5.13, with controls for presenting it.
Keep this page on your own screen. Share only the lesson window. The lesson window holds no teaching notes, so sharing it cannot show them.
Presenting
- Open the lesson in its own window and share that window, not this one.
- Use Next and Previous here, or the lesson’s own, to move through the lesson. Next reveals one thing at a time: the next idea, or the answer to the question on screen, then the next step. Previous takes the last reveal back. The line below says what is on screen and what Next will show.
- Reveal hints and answers when the class is ready, and reset a demonstration before using it again.
The controls need JavaScript and a browser that supports BroadcastChannel. Without them, open the lesson in presentation mode and use its own controls.
The two windows talk to each other only inside this browser, on this device. Nothing is sent to a server, and no account is needed. A second device (a phone or another tablet) cannot follow the lesson window yet.
Now on the lesson window
- On screen
- Next teaching point
Guidance for this point
Lesson plan
- Level
- Intermediate
- Time
- About 75 minutes; the steps below add up to 68
Pupils choose their own six test values for a booking rule, sort them into accepted and refused, find the edges for themselves, and only then meet normal, abnormal, extreme and boundary data. A faulty program shows why the edges matter, and pupils build test plans that state the expected result before any test is run.
Objectives
- Explain why a program is tested with data whose correct result is worked out first
- Classify test data as normal, abnormal, extreme or boundary for a given rule
- Choose the boundary data for a range, including the values just outside it
- Write a test plan with the data, its type and the expected result for each test
- Use a test plan to find a mistake in a condition
- Explain what passing every test does and does not show
Before the lesson
- Mini whiteboards for pupils to record their six values and, later, a test plan.
- A number line drawn on the board from -2 to 9 for the cinema rule, to mark the four kinds of data as they are named.
- Optional: a laptop with the Python box ready, to show the faulty check failing at 1 and 6.
Steps
Introduction Opening
On the lesson window now
On screen: the lesson’s title, module and number; Next adds its objectives and key terms, as the lesson page lists them; Next again begins the first step.
Objectives on screen
- Explain why a program is tested with data whose correct result is worked out first
- Classify test data as normal, abnormal, extreme or boundary for a given rule
- Choose the boundary data for a range, including the values just outside it
- Write a test plan with the data, its type and the expected result for each test
- Use a test plan to find a mistake in a condition
- Explain what passing every test does and does not show
Purpose: Pupils choose their own six test values for a booking rule, sort them into accepted and refused, find the edges for themselves, and only then meet normal, abnormal, extreme and boundary data. A faulty program shows why the edges matter, and pupils build test plans that state the expected result before any test is run.
1. Six chances to test Think 8 min
On the lesson window now
Purpose: Pupils choose values before the vocabulary exists, so that the four names later label choices they already made.
Ask
- Which six values would you type, and why?
- What would each one show?
Responses to expect
- A typical value, the limits 1 and 6, values just outside such as 0 and 7, and something silly such as “two”
Misconceptions to challenge
- A learner may believe: “Test with typical values, because those are what customers type.” Respond: Ask: who will type 0 or a word? What would the program do?
On the board or with the pen
- Write the class’s values on the number line without names, as an unsorted collection to sort in step 2.
Discussion pause: Two minutes to choose silently, then pairs compare lists.
In the lesson window
- Think it through: Which six values would you type in, and why? Think about what each one would show you.
2. Data to accept and data to refuse Discover 8 min
On the lesson window now
Purpose: Pupils sort their values into accepted and refused, and see why expected results are decided first.
Ask
- Which of your values should be accepted?
- Why decide the expected result before running the program?
Responses to expect
- The typical values and the limits 1 and 6
- Otherwise you might believe whatever the program says
Misconceptions to challenge
- A learner may believe: “A good test shows the program accepting good data.” Respond: Half of a test is checking that the program refuses what it should refuse.
Checking understanding: The normal-example question checks that pupils can pick data that should be accepted.
English as an additional language
- Introduce accept and refuse with a gesture: a door opening and a door shut.
In the lesson window
- Think it through: Your six values fall into two groups: ones the program should accept and ones it should refuse. Which of your values are in each group? Why does it matter to know the answer before you run the program?
- Check your understanding: The cinema rule allows 1 to 6 tickets. Which of these is normal data?
3. The edges of a rule Discover 10 min
On the lesson window now
Purpose: Pupils list the values at the edges before extreme and boundary are defined, so that the two definitions have something to attach to.
Ask
- Which whole numbers sit right at the edges of 1 to 6?
- Which of them should the program accept?
Responses to expect
- 0 and 1 at the bottom; 6 and 7 at the top
- 1 and 6 accepted; 0 and 7 refused
Misconceptions to challenge
- A learner may believe: “Extreme data and boundary data are the same thing.” Respond: Extreme data is only the largest and smallest acceptable values. Boundary data adds the nearest refused values.
- A learner may believe: “The boundary data of 8 to 16 is 8 and 16.” Respond: That is the extreme data. What are the nearest values that should be refused?
On the board or with the pen
- Mark 0, 1, 6 and 7 on the number line; circle the extreme data in one colour and the boundary data in another.
Checking understanding: The boundary-list question shows who includes the refused values.
Depending on the answers
- If many pupils choose 8 and 16: return to the number line and ask which values the program should refuse, then add them
- If pupils ask about decimals: point to the supplementary note: exam questions normally use whole numbers
In the lesson window
- Think it through: Mistakes in programs often happen at the edges of a rule. For the cinema rule, 1 to 6 tickets, list every whole number right at the edges, on either side of each limit, and say which the program should accept.
- Check your understanding: A swimming club accepts whole-number ages from 8 to 16. Which list is the boundary data?
4. Why the edges catch mistakes Predict 10 min
On the lesson window now
Purpose: Pupils predict that a faulty program passes 3 and 4 but fails at the limits, then see it in a table.
Ask
- Is it enough that Sam’s program accepts 3 and 4?
- What does it do with 1 and 6?
Responses to expect
- No
- It refuses both
Misconceptions to challenge
- A learner may believe: “If every test passes, the program is correct.” Respond: Passing shows the program works for the data tried. Use the second misconception callout.
Checking understanding: The fault-found-by question: which kind of data found the fault?
Stretch
- Write a faulty condition that fails only at the top limit, and the test that would find it.
In the lesson window
- Think it through: Sam says: “It accepts 3 and 4, so it works.” Is that enough evidence? Predict what the program does with 1 and with 6.
- Check your understanding: Which kind of test data found the fault in Sam’s program?
5. Building a test plan Explain 12 min
On the lesson window now
Purpose: A worked example of building a plan from the rule, then a plan with blanks for pupils to complete.
Ask
- What is the rule, exactly?
- What is the expected result of each test?
Responses to expect
- Whole numbers from 8 to 16 are accepted
- Accepted for 8 to 16, otherwise rejected
Misconceptions to challenge
- A learner may believe: “A test plan is written after the tests, to record what happened.” Respond: The expected results are decided first, from the rule, so the plan can judge the program.
On the board or with the pen
- Build the swimming club plan on the board row by row, asking pupils for each row.
Support
- Give the swimming plan with the data column filled and ask only for the type and the expected result.
In the lesson window
- Apply it: A website accepts passwords from 8 to 12 characters. A tester wants the boundary data, written as password lengths. Which lengths should they choose?
6. Write a plan on your own Apply 12 min
On the lesson window now
Purpose: Independent writing: a complete plan for a new rule, then two further applications.
Ask
- What are the four boundary values for lockers 100 to 250?
- What is missing from Priya’s plan?
Responses to expect
- 99, 100, 250 and 251
- The values just outside the range
Misconceptions to challenge
- A learner may believe: “The abnormal data is the values just outside the range.” Respond: Those are boundary data. Abnormal data is the wrong type or far outside.
Checking understanding: Collect the paper plans; check that every one has the four boundary values and an expected result for each test.
In the lesson window
- Think it through: Write a test plan with at least eight tests: one normal, two extreme, four boundary (counting the extreme values) and some abnormal data. For each, give the data, its type and the expected result.
- Apply it: What is missing from Priya’s plan?
- Apply it: A tester wants one item of data of the wrong type for the cinema rule, which expects a whole number of tickets. Which should they choose?
7. Show what you know Consolidate 8 min
On the lesson window now
Purpose: Explanation of why the edges are chosen, and a statement of what a passing plan shows.
Ask
- Why choose 0, 1, 6 and 7 and not 2 to 5?
- What can you conclude when every test passes?
Responses to expect
- Mistakes show at the limits, and 2 to 5 behave alike
- It works for the data tried: good evidence, not proof
Checking understanding: The all-tests-pass question diagnoses over-claiming.
Depending on the answers
- If pupils say the program is certainly correct: ask whether the test plan tried every number; return to Sam’s program passing 3 and 4
In the lesson window
- Think it through: Explain to a classmate why a tester chooses 0, 1, 6 and 7 for the cinema rule, and does not bother with 2, 3, 4 and 5 as well.
- Apply it: A program passes every test in a well-chosen plan. Which statement is the fairest?
- Think it through: Which kind of test data (normal, abnormal, extreme or boundary) do you find hardest to choose? Write one example rule of your own and the data you would pick for it.
Lesson recap Closing
On the lesson window now
On screen: the lesson’s objectives again; Next adds the closing question, which asks the class to explain each one in their own words without looking back. It says nothing about what anyone has learnt: use the answers to decide what to revisit.
Points to listen for
- Test data has its expected result worked out before the test.
- Normal data should be accepted; abnormal data should be refused.
- Extreme data is the largest and smallest acceptable values; boundary data adds the nearest refused values.
- Passing a good test plan is good evidence, not proof.
Consolidation
- Test data has its expected result worked out before the test.
- Normal data should be accepted; abnormal data should be refused.
- Extreme data is the largest and smallest acceptable values; boundary data adds the nearest refused values.
- Passing a good test plan is good evidence, not proof.