Learning Objectives
By the end of this lesson, you will be able to:
- Definewhat is meant by "suitable test data"
- Describethe four categories of test data: normal, abnormal, extreme and boundary
- Suggestsuitable test data for a given program or scenario
- Applytest data to check that a program works as intended
- Compareactual results with expected results
- Explainwhy each value was chosen as test data
Key Terms
Suitable test data
Specially chosen data to test the functionality of a program or design. Results are compared to expected results to check if the algorithm works as intended.
Normal data
Data that should be accepted by the program without causing errors.
Abnormal data
Data that is the wrong data type or in the wrong format. It should be rejected by the program — this includes no input when one is expected.
Extreme data
The maximum and minimum values of normal data that are accepted by the system.
Boundary data
Data that is the largest/smallest acceptable value as well as the corresponding smallest/largest rejected value — values on either side of the extreme.
No data
A special case where nothing is entered — not strictly invalid or abnormal, but certainly not what you want the user to do.
1. What is Suitable Test Data?
Suitable test datais specially chosen to test the functionality of a program or design. Developers or test-users would pick a selection of test data from the following categories:
Normal
Abnormal
Extreme
Boundary
The results would be compared to theexpected resultsto check if the algorithm or program works as intended. Each category is explained within the context of a simple Python program below.
Python Example: Age Check
1.1 Normal Data
Normal data
Normal test data is data thatshould be acceptedin the program.
Example:A user entering their age as16into the age field of the program.
1.2 Abnormal Data
Abnormal data
Abnormal test data is data that is thewrong data typeor format. It should be rejected by the program.
Example:A user entering their age as"F"into the age field of the program.
1.3 Extreme Data
Extreme data
Extreme test data is themaximum and minimum values of normal datathat are accepted by the system.
Example:A user entering their age as18or12into the age field of the program.
1.4 Boundary Data
Boundary data
Boundary test data is similar to extreme data except that the valueson either side of the maximum and minimum values are tested.
The largest and smallest acceptable value is tested as well as the largest and smallest unacceptable value.
Example:A user entering their age as11or19into the age field of the program.
1.5 Selecting Suitable Test Data
| Type of Test | Input | Expected Output |
|---|---|---|
| Normal | 14 | Accepted |
| Normal | 16 | Accepted |
| Extreme | 12 | Accepted |
| Extreme | 18 | Accepted |
| Abnormal | H | Rejected |
| Abnormal | @ | Rejected |
| Boundary | 11 | Rejected |
| Boundary | 19 | Rejected |
Interactive: Test the Age Check Program
The program accepts ages between 12 and 18 (inclusive). Try entering each of the test data values below and see whether the program accepts or rejects them.
Program output will appear here.
How it works:Enter a value to see whether the program accepts or rejects it. Try each category to see the different types of test data in action.
Activity 1: Categorise the Test Data
A program asks the user for a percentage mark (0–100 inclusive). Classify each of the following values as normal, abnormal, extreme or boundary:
- 55
- 0
- 100
- -1
- 101
- "abc"
Solution:
- Normal— 55 is a typical value in the accepted range.
- Extreme— 0 is the minimum acceptable value.
- Extreme— 100 is the maximum acceptable value.
- Boundary— -1 is the value just below the minimum acceptable value and should be rejected.
- Boundary— 101 is the value just above the maximum acceptable value and should be rejected.
- Abnormal— "abc" is the wrong data type and should be rejected.
Check Your Understanding: Test Data Categories
1. Define "suitable test data". [2 marks]
Answer
- [1 mark]Specially chosen data used to test the functionality of a program or design
- [1 mark]Results are compared to expected results to check whether the algorithm/program works as intended
2. Name the four categories of test data. [4 marks]
Answer
- [1 mark]Normal
- [1 mark]Abnormal
- [1 mark]Extreme
- [1 mark]Boundary
3. Describe what is meant by "abnormal data" and give an example. [3 marks]
Answer
- [1 mark]Abnormal data is data that is the wrong data type or in the wrong format
- [1 mark]It should be rejected by the program — includes no input when one is expected
- [1 mark]Example: entering "F" or "@" instead of a number for an age field
4. Explain the difference between extreme data and boundary data. [3 marks]
Answer
- [1 mark]Extreme data is the maximum and minimum values that areacceptedby the system
- [1 mark]Boundary data is the valueson either sideof the extreme values — the largest/smallest acceptable value and the corresponding smallest/largest rejected value
- [1 mark]Example: if ages 12–18 are accepted, then 12 and 18 are extreme data, while 11 and 19 are boundary data (they should be rejected)
5. Why should the special case of "no data" always be tested? [2 marks]
Answer
- [1 mark]No data being entered isn't strictly invalid or abnormal, but it isn't what you want the user to do
- [1 mark]Testing with no data ensures the program handles blank input gracefully without crashing
6. Why is it important to test a program with more than just normal data? [3 marks]
Answer
- [1 mark]Normal data only shows the program works for typical inputs — it does not check boundaries or error handling
- [1 mark]Abnormal data checks the program rejects wrong data types without crashing
- [1 mark]Extreme and boundary data check the edges of the acceptable range are handled correctly
3. Case Study: Car Park Ticket Machine
What data could be used for this car park ticket machine software?
Birmingham Town Hall Car Park — Charges & Opening Times
Opening Times:
- Monday to Saturday: 7am to midnight
- Sunday: 9am to midnight
- Vehicles cannot be retrieved when car park is closed
Monday to Saturday charges:
- Up to 1 hour: £1.00
- Up to 2 hours: £2.10
- Up to 3 hours: £3.10
- Up to 4 hours: £4.30
- Up to 6 hours: £6.40
- More than 6 hours and up to 24 hours: £9.20
Evenings (after 6pm until midnight): £2.50
Sunday (all day, until midnight): £2.50
Shoppers arriving after 9:30am (up to 5 hours): £3.00
Additional charge for lost or damaged cards: £10.50
Use 10p, 20p, 50p, £1, £2 coins and/or £5, £10, notes only
3.1 Suitable Test Data for Car Park System
What data could be used for this car park ticket machine software?
½ hour parking
1 hour parking
1½ hour parking
Sunday parking
Evening parking past 7pm
Parking before 9:30am
Parking after 9:30am
Parking during invalid opening hours
Why so many test values?
This program has many rules — different charges apply depending on the day, the time, and how long the car is parked. To test it thoroughly, the developer needs to try values that cover every rule: normal values within each pricing band, boundary values at the edge of each band, extreme values (the shortest and longest allowed parking times), and abnormal values (invalid times, wrong data types, invalid opening hours).
Check Your Understanding: Car Park Case Study
1. Why is "½ hour parking" a useful test value for this system? [2 marks]
Answer
- [1 mark]It is a value within the "up to 1 hour" pricing band, testing the lower end of that band
- [1 mark]It checks the system handles part-hour parking correctly and charges the correct amount (£1.00)
2. Suggest one boundary value for the "up to 2 hours" pricing band and explain your choice. [2 marks]
Answer
- [1 mark]2 hours exactly is the boundary of the "up to 2 hours" band — it should be accepted at £2.10
- [1 mark]2 hours 1 minute would be a boundary value just outside this band, falling into the "up to 3 hours" band at £3.10
3. Explain why "parking during invalid opening hours" is classified as abnormal data. [2 marks]
Answer
- [1 mark]The car park is closed outside its opening times, so parking during those hours is not a valid scenario
- [1 mark]The system should reject the input or handle it as an error rather than processing a charge
4. Why does this car park system need more test values than the simple menu choice program? [3 marks]
Answer
- [1 mark]The car park system has many more rules — different charges depending on day, time, and duration
- [1 mark]Each pricing band and opening-hour rule needs its own normal, extreme and boundary tests
- [1 mark]Thorough testing is needed to ensure correct charges are calculated and invalid inputs (closed hours, wrong coin types, etc.) are handled properly
4. Worked Example & Past Paper Practice
Worked Example: Prices Less Than $10.00
A programmer has written an algorithm to check that prices are less than $10.00. These values are used as test data:10.00,9.99,ten.
State why each value was chosen as test data. [3 marks]
Show Mark Scheme
Answer (3 marks):
- [1 mark]10.00is boundary or abnormal data and should berejectedas it is out of range (prices must beless than$10.00, so 10.00 exactly is not allowed)
- [1 mark]9.99is boundary, extreme and normal data and should beacceptedas it is within the normal range (it is the maximum acceptable value)
- [1 mark]tenis abnormal data and should berejectedas it is the wrong value type (a string, not a number)
Past Paper Style Question: Password Validation
A program asks the user to create a password. The password must be between 8 and 16 characters long (inclusive).
Suggest suitable test data for this program and state the expected result for each value.
Show Mark Scheme
Example Answer:
| Type of test | Input | Expected output |
|---|---|---|
| Normal | "Password123" (11 chars) | Accepted |
| Extreme | 8-character password | Accepted |
| Extreme | 16-character password | Accepted |
| Boundary | 7-character password | Rejected |
| Boundary | 17-character password | Rejected |
| Abnormal | (blank / no data) | Rejected |
Key Takeaways
- Suitable test datais specially chosen to test the functionality of a program or design.
- There arefour main categoriesof test data: normal, abnormal, extreme and boundary.
- Normal datais data that should be accepted without causing errors.
- Abnormal datais data that should be rejected — it is the wrong data type or format, and includes no input when one is expected.
- Extreme datais the maximum and minimum values that are accepted by the system.
- Boundary datais the largest/smallest acceptable value as well as the corresponding smallest/largest rejected value — values on either side of the extreme.
- No datashould always be tested as a special case, since it's not what you want the user to do.
- Results are compared toexpected resultsto check whether the algorithm/program works as intended.
- Programs with many rules (e.g. a car park ticket machine) needmore test valuesto cover every pricing band, opening-hour rule and edge case.
- Testing with only normal data isnot enough— abnormal, extreme and boundary tests are needed to fully verify the program.
Question Bank
1. Define suitable test data and name the four categories. [6 marks]
Answer
- [2 marks]Suitable test data— specially chosen data used to test the functionality of a program or design; results are compared to expected results
- [1 mark]Normal data
- [1 mark]Abnormal data
- [1 mark]Extreme data
- [1 mark]Boundary data
2. A program accepts a mark between 0 and 100 inclusive. Suggest two normal, two extreme, two boundary and two abnormal test values. [8 marks]
Answer
| Type | Input | Expected |
|---|---|---|
| Normal | 45 | Accepted |
| Normal | 72 | Accepted |
| Extreme | 0 | Accepted |
| Extreme | 100 | Accepted |
| Boundary | -1 | Rejected |
| Boundary | 101 | Rejected |
| Abnormal | "abc" | Rejected |
| Abnormal | # | Rejected |
Marking:1 mark per correct row (2 per category), max 8.
3. Explain the difference between extreme data and boundary data, using an example. [4 marks]
Answer
- [2 marks]Extreme datais the maximum and minimum values of normal data that areacceptedby the system
- [2 marks]Boundary datais the values on either side of the maximum and minimum — the largest/smallest acceptable value as well as the smallest/largest rejected value
- [Example]If the accepted range is 12–18: 12 and 18 are extreme data (accepted); 11 and 19 are boundary data (rejected).
4. A menu system asks the user to enter a choice between 1 and 5. Construct a test data table showing at least 6 test values with the expected output for each. [6 marks]
Answer
| Type | Input | Expected output |
|---|---|---|
| Normal | 3 | Accepted |
| Extreme | 1 | Accepted |
| Extreme | 5 | Accepted |
| Boundary | 0 | Rejected |
| Boundary | 6 | Rejected |
| Abnormal | "X" | Rejected |
Marking:1 mark per correct row, max 6.
5. A programmer has written an algorithm to check that prices are less than $10.00. Test data used: 10.00, 9.99, ten. State why each value was chosen. [3 marks]
Answer
- [1 mark]10.00is boundary or abnormal data and should be rejected as it is out of range (prices must be less than $10.00)
- [1 mark]9.99is boundary, extreme and normal data and should be accepted as it is within the normal range (maximum acceptable value)
- [1 mark]tenis abnormal data and should be rejected as it is the wrong value type
6. Why should a program always be tested with the special case of "no data" being entered? [2 marks]
Answer
- [1 mark]No data being entered isn't strictly invalid or abnormal, but it isn't what you want the user to do
- [1 mark]Testing this case ensures the program handles blank input gracefully without crashing or producing unexpected results
7. Explain why testing a program with only normal data is not sufficient. [3 marks]
Answer
- [1 mark]Normal data only shows the program works for typical inputs — it does not test the boundaries
- [1 mark]It does not check whether the program correctly rejects invalid (abnormal) inputs
- [1 mark]Extreme and boundary tests are needed to make sure the edges of the acceptable range are handled correctly
8. A car park system charges £1.00 for up to 1 hour of parking, £2.10 for up to 2 hours, etc. Suggest suitable boundary test data for the "up to 2 hours" band. [4 marks]
Answer
- [1 mark]Just over 1 hour (e.g. 1 hour 1 minute) — the lower boundary of the "up to 2 hours" band, charged at £2.10
- [1 mark]Exactly 2 hours — the upper boundary of the "up to 2 hours" band, still charged at £2.10
- [1 mark]Just over 2 hours (e.g. 2 hours 1 minute) — just outside the band, charged at £3.10 (moves into "up to 3 hours" band)
- [1 mark]These values test the edges of the pricing band, confirming the system charges the correct amount at each boundary