Test Data
Suggesting and applying suitable test data
- Before a system is used, each sub-system must be tested to ensure it works correctly and interacts correctly with other sub-systems
- Programs are tested by running them on a computing device while pseudocode and flowcharts must be dry run manually. Both require suitably chosen and different sets of test data. The outputs are then compared to the expected output to check if the algorithm works as intended
- Test data comes in several generic types:
- Normal
-
-
- Normal test data is data that a system would be expected to handle on a day-to-day basis, be accepted by the algorithm and produce expected results
- Examples could include entering people's names and addresses, phone numbers, student grades as a percentage, etc
- Student percentage grades could involve test data such as: 34, 41, 56, 78, 12, 92
- Abnormal
- Also known as erroneous data, abnormal data is data that is expected to fail and should be rejected by the system. This is used to prove that the system works correctly by rejecting incorrect data
- Examples of abnormal data would be entering numbers instead of someone's name, or entering text instead of numbers
- Student percentage grades abnormal data could involve test data such as: abc, 7&n, Harry, £300, <!%, etc
- Extreme
- Extreme test data is the maximum and minimum values of normal data that are accepted by the system
- Examples could include percentages (0 and 100), days in April (1 and 30) or the number of characters in a passwords range
- For an 8-20 character range password, a password of 8 characters and another of 20 characters would be tested
- Boundary
- Boundary test data is similar to extreme data except that the values on 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
- For example, a percentage boundary test would be 0 and -1 (for 0) and 100 and 101 (for 100). For the days in April, 1 and 0 (for day 1) and 30 and 31 (for day 30) would be tested. For an 8-20 length password, an 8 and 7 character password would be tested as well as a 20 and 21 character password
-
Worked example
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]
10.00 is boundary or abnormal data and should be rejected as it is out of range [1]
9.99 is boundary, extreme and normal data and should be accepted as it is within the normal range [1]
Ten is abnormal data and should be rejected as it is the wrong value type [1]