Extreme test data

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Extreme test data

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A program accepts ages from 0 to 120. Which pair is the extreme test data?
A 0 and 120
B -1 and 121
2. What should a program do with extreme test data?
A Accept it
B Reject it
3. For a range check of 1 to 50, which value is extreme test data?
A 51
B 50
4. Where does extreme test data sit in a range 0 to 120?
A In the middle of the range
B Exactly on the limits
5. True or false: 60 is extreme test data for a range of 0 to 120.
A False
B True

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Range check 0 to 120: test 0 AExtreme data: 0 and 120
2Range check 0 to 120: test 120 BExtreme test data on the largest acceptable value. The program should accept it.
3Extreme test data for a range of 0 to 120 uses the two limits themselves CExtreme test data on the smallest acceptable value. The program should accept it.
4Extreme test data sits exactly on the limits and the expected outcome is accepted DTest data 120, expected outcome: accepted
5Extreme data for 0 to 120: -1 and 121, expected outcome: accepted EExtreme data is valid, so the expected outcome should be accepted, not rejected.
6Extreme data for 0 to 120: 0 and 120, expected outcome: rejected F-1 and 121 are just outside the range, so they are not extreme data and should be rejected. Extreme data is 0 and 120.

Definitions

Extreme test data

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Age ← ___ IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
2.
Age ← _ IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
3.
Age ← 120 IF Age >= 0 AND Age __ 120 THEN OUTPUT "Accepted"
4.
Age ← 0 IF Age >= 0 ___ Age <= 120 THEN OUTPUT "Accepted"
5.
Age ← 0 IF Age __ 0 AND Age <= 120 THEN OUTPUT "Accepted"

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A // Age range is 0 to 120
B Extreme test data: 0 and 120
C Expected result: rejected
Question 2
A // Age range is 0 to 120
B Extreme data: 1 and 119
C Expected result: accepted
Question 3
A Extreme data is outside limits
B Range check: 0 to 120
C Extreme values: 0 and 120
Question 4
A Age ← 120
B IF Age >= 0 AND Age <= 120
C THEN
D OUTPUT "Rejected"
E ENDIF
Question 5
A // Smallest extreme value
B Age ← 0
C IF Age > 0 AND Age <= 120
D THEN OUTPUT "Accepted"
E ENDIF

Answer Key

Extreme test data
Section A: Quick Questions
Q1
A — 0 and 120
Q2
A — Accept it
Q3
B — 50
Q4
B — Exactly on the limits
Q5
A — False
Section B: Match the Pairs
Q1
Range check 0 to 120: test 0 → Extreme test data on the smallest acceptable value. The program should accept it.
Q2
Range check 0 to 120: test 120 → Extreme test data on the largest acceptable value. The program should accept it.
Q3
Extreme test data for a range of 0 to 120 uses the two limits themselves → Extreme data: 0 and 120
Q4
Extreme test data sits exactly on the limits and the expected outcome is accepted → Test data 120, expected outcome: accepted
Q5
Extreme data for 0 to 120: -1 and 121, expected outcome: accepted → -1 and 121 are just outside the range, so they are not extreme data and should be rejected. Extreme data is 0 and 120.
Q6
Extreme data for 0 to 120: 0 and 120, expected outcome: rejected → Extreme data is valid, so the expected outcome should be accepted, not rejected.
Section C: Definitions
Q1
Extreme test data — The largest and smallest values a program should accept, such as 0 and 120 for a range of 0 to 120. They sit exactly on the limits and the expected outcome is accepted.
Section D: Fill in the Blanks
Q1
Age ← 120 IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
Q2
Age ← 0 IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
Q3
Age ← 120 IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
Q4
Age ← 0 IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
Q5
Age ← 0 IF Age >= 0 AND Age <= 120 THEN OUTPUT "Accepted"
Section E: Spot the Error
Q1
C — Extreme test data sits exactly on the limits of the range, so the program should accept it. The line should say 'Expected result: accepted'.
Q2
B — Extreme data is the smallest and largest acceptable values. For a range of 0 to 120 these are 0 and 120, not 1 and 119. The line should be 'Extreme data: 0 and 120'.
Q3
A — Extreme data is still acceptable data. It sits exactly on the limits of the range, not outside them. The line should say 'Extreme data is on the limits'.
Q4
D — 120 is the largest value in the range 0 to 120, so it is extreme data and must be accepted. The line should be OUTPUT "Accepted".
Q5
C — Using > would wrongly reject 0, which is the smallest acceptable value. The condition should use >= so the lower limit is accepted: IF Age >= 0 AND Age <= 120.