Suggesting test data for a range check

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

Suggesting test data for a range check

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A score must be from 0 to 100. Which is a NORMAL test value?
A 101 - it is inside the range, so it is accepted
B 50 - it is inside the range, so it is accepted
2. A score must be from 0 to 100. Which is a good ABNORMAL test value?
A -5 or "abc" - the data is invalid, so it is rejected
B -5 or "abc" - the data is valid, so it is accepted
3. For a score from 0 to 100, which pair are the EXTREME test values?
A -1 and 101 - the largest and smallest allowed values, accepted
B 0 and 100 - the largest and smallest allowed values, accepted
4. For a score from 0 to 100, which pair are the BOUNDARY test values at the upper limit?
A 100 accepted and 101 rejected
B 100 rejected and 101 accepted
5. For a score from 0 to 100, what should happen to the boundary test value -1?
A It is rejected because it is just below the lowest allowed value 0
B It is accepted because it is just below the lowest allowed value 0

Match the Pairs

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

Left columnRight column
150 A"abc" is not a number, so it is abnormal data and should be rejected. Normal data must be valid and inside the range.
2-5 BAbnormal test data for a score from 0 to 100. It is outside the range, so it is rejected.
3Extreme test data is the largest or smallest value that is still allowed, so it is accepted CNormal test data for a score from 0 to 100. It is inside the range, so it is accepted.
4Boundary test data is the first value just outside the range, so it is rejected D101 is outside the range 0 to 100, so it should be rejected. It is boundary data, not extreme data, because it is just beyond the limit.
5Test data for 0 to 100: 101 is extreme data and should be accepted E101
6Test data for 0 to 100: "abc" is normal data and should be accepted F100

Definitions

Range check test data

Fill in the Blanks

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

1.
Range check: 0 to 100 50 - normal - ______
2.
Range check: 0 to 100 -5 - ________ - REJECT
3.
Range check: 0 to 100 Lowest extreme value: _
4.
Range check: 0 to 100 101 - boundary - ______
5.
IF Score >= 0 ___ Score <= 100 THEN

Spot the Error

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

Question 1
A Range check: 0 to 100
B 50 is normal: accept
C -5 is abnormal: accept
Question 2
A Range check: 0 to 100
B 100 is extreme: reject
C 0 is extreme: accept
Question 3
A Range check: 0 to 100
B 50 is normal: accept
C 100 is boundary: accept
D 101 is boundary: accept
Question 4
A Range check: 1 to 100
B 0 is extreme: accept
C -1 is boundary: reject
Question 5
A IF Score >= 0 OR Score <= 100
B THEN OUTPUT "Accept"
C ELSE OUTPUT "Reject"
D ENDIF

Answer Key

Suggesting test data for a range check
Section A: Quick Questions
Q1
B — 50 - it is inside the range, so it is accepted
Q2
A — -5 or "abc" - the data is invalid, so it is rejected
Q3
B — 0 and 100 - the largest and smallest allowed values, accepted
Q4
A — 100 accepted and 101 rejected
Q5
A — It is rejected because it is just below the lowest allowed value 0
Section B: Match the Pairs
Q1
50 → Normal test data for a score from 0 to 100. It is inside the range, so it is accepted.
Q2
-5 → Abnormal test data for a score from 0 to 100. It is outside the range, so it is rejected.
Q3
Extreme test data is the largest or smallest value that is still allowed, so it is accepted → 100
Q4
Boundary test data is the first value just outside the range, so it is rejected → 101
Q5
Test data for 0 to 100: 101 is extreme data and should be accepted → 101 is outside the range 0 to 100, so it should be rejected. It is boundary data, not extreme data, because it is just beyond the limit.
Q6
Test data for 0 to 100: "abc" is normal data and should be accepted → "abc" is not a number, so it is abnormal data and should be rejected. Normal data must be valid and inside the range.
Section C: Definitions
Q1
Range check test data — Pick one normal, abnormal, extreme and boundary value for the range and say accept or reject. For 0 to 100: 50 normal, -5 abnormal, 100 extreme, 101 boundary.
Section D: Fill in the Blanks
Q1
Range check: 0 to 100 50 - normal - ACCEPT
Q2
Range check: 0 to 100 -5 - abnormal - REJECT
Q3
Range check: 0 to 100 Lowest extreme value: 0
Q4
Range check: 0 to 100 101 - boundary - REJECT
Q5
IF Score >= 0 AND Score <= 100 THEN
Section E: Spot the Error
Q1
C — -5 is below 0, so it is outside the range. Abnormal data must be rejected, so the line should say reject.
Q2
B — 100 is the largest value allowed, so it is extreme data and it is valid. It should be accepted, not rejected.
Q3
D — 101 is just above the highest allowed value of 100. It is a boundary value that is invalid, so it must be rejected.
Q4
A — The range starts at 0, not 1. The other lines accept 0 as extreme data, so the first line should be Range check: 0 to 100.
Q5
A — A range check needs AND, because the score must be at least 0 and at most 100. With OR every number passes, so abnormal data like -5 would be accepted.