Test data

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

Test data

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which describes test data?
A Input values chosen before testing so results can be compared with expected results
B The final output a program prints after it has been released to users
2. A program accepts ages from 12 to 18. Which is normal test data?
A abc
B 15
3. A program accepts ages from 12 to 18. Which is abnormal test data?
A twelve
B 13
4. When should test data be chosen?
A After the program runs, by looking at whatever it outputs
B Before the testing starts, along with the expected results
5. A mark must be between 0 and 100. Which pair are the extreme values of the accepted range?
A 0 and 100
B -1 and 101

Match the Pairs

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

Left columnRight column
1Range 0-100, test data: 50 ANormal test data: a valid value that should be accepted
2Range 0-100, test data: -5 BRange 1-10, test data: 1, 10, 0, 11
3Boundary test data uses the values at the edge of the accepted range and the values just outside it CInput: 150 | Expected: Rejected
4Test data is chosen before testing, with an expected result written for each value to compare with the actual result DThese values are inside the range (1 and 100 are boundary values), so they should be accepted, not rejected.
5Range 1-10, normal test data: 11 EAbnormal test data: an invalid value that should be rejected
6Range 1-100, test data 1, 50, 100: all rejected F11 is outside the range, so it is abnormal data not normal data. Normal data should be a valid value such as 5.

Definitions

test data

Fill in the Blanks

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

1.
// Valid age is 1 to 100 // Test data 50 is ______ data
2.
// Valid age is 1 to 100 // Test data -5 is ________ data
3.
// Valid age is 1 to 100 // 0 and 1 are ________ test data
4.
INPUT Age IF Age >= 1 ___ Age <= 100 THEN OUTPUT "Accepted"
5.
DECLARE TestAge : INTEGER _____ TestAge OUTPUT TestAge

Spot the Error

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

Question 1
A // Range check 1 to 100
B // Normal test data
C TestData ← 150 // accepted
Question 2
A // Range check 1 to 100
B // Abnormal test data
C TestData ← 55 // rejected
Question 3
A // Mark must be 0 to 100
B // Boundary test data
C TestData ← 100 // accepted
D TestData ← 101 // accepted
Question 4
A // Abnormal test data
B // Range check 1 to 10
C TestData ← 1 // accepted
D TestData ← 10 // accepted
Question 5
A // 1. Choose test data first
B // 2. Run the program with it
C // 3. Compare with the input

Answer Key

Test data
Section A: Quick Questions
Q1
A — Input values chosen before testing so results can be compared with expected results
Q2
B — 15
Q3
A — twelve
Q4
B — Before the testing starts, along with the expected results
Q5
A — 0 and 100
Section B: Match the Pairs
Q1
Range 0-100, test data: 50 → Normal test data: a valid value that should be accepted
Q2
Range 0-100, test data: -5 → Abnormal test data: an invalid value that should be rejected
Q3
Boundary test data uses the values at the edge of the accepted range and the values just outside it → Range 1-10, test data: 1, 10, 0, 11
Q4
Test data is chosen before testing, with an expected result written for each value to compare with the actual result → Input: 150 | Expected: Rejected
Q5
Range 1-10, normal test data: 11 → 11 is outside the range, so it is abnormal data not normal data. Normal data should be a valid value such as 5.
Q6
Range 1-100, test data 1, 50, 100: all rejected → These values are inside the range (1 and 100 are boundary values), so they should be accepted, not rejected.
Section C: Definitions
Q1
test data — The input values chosen before testing, such as normal, abnormal, extreme and boundary values, used to run a program so its results can be compared with the expected results.
Section D: Fill in the Blanks
Q1
// Valid age is 1 to 100 // Test data 50 is normal data
Q2
// Valid age is 1 to 100 // Test data -5 is abnormal data
Q3
// Valid age is 1 to 100 // 0 and 1 are boundary test data
Q4
INPUT Age IF Age >= 1 AND Age <= 100 THEN OUTPUT "Accepted"
Q5
DECLARE TestAge : INTEGER INPUT TestAge OUTPUT TestAge
Section E: Spot the Error
Q1
C — 150 is outside the range 1 to 100, so it is abnormal data and would be rejected. Normal test data must be inside the range, for example 50.
Q2
C — 55 is inside the range 1 to 100, so it is normal data and would be accepted. Abnormal test data must be outside the range, for example -5.
Q3
D — 101 is just outside the boundary of 0 to 100, so it should be rejected. The expected result for 101 is rejected, not accepted.
Q4
A — 1 and 10 are the smallest and largest values the range accepts, so they are extreme test data. Abnormal data would be rejected, but these are accepted.
Q5
C — The results of running the program are compared with the expected results, which are decided before testing. They are not compared with the input.