Algorithm Design and Problem Solving · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 6% of your exam marks.
Decomposition, abstraction and structure charts appear as design-focused questions.
Test data is a carefully chosen set of inputs used to check that a program works correctly.
Different kinds of test data probe different parts of the program's behaviour. The syllabus names four categories.
Normal data is data that the program should accept because it is within the expected, valid range.
For a program that accepts ages from 12 to 18:
Normal data shows that the program does what it is supposed to do for typical input.
Extreme data is the largest and smallest values that should still be accepted.
For ages 12 to 18, the extremes are 12 and 18: the valid endpoints. Both should be accepted, because they are the smallest and largest values inside the allowed range.
tests the values either side of a limit: at each end of the range, the largest accepted value together with the smallest rejected value (the value just past the limit).
Boundary data checks both sides of each threshold, so for ages 12 to 18 the boundary tests are:
Boundary data is where bugs often hide: many off-by-one errors only show up at the very edge of the valid range. Extreme data uses only the accepted endpoints (12 and 18); boundary data pairs each accepted endpoint with the rejected value immediately beyond it (so it also tests 11 and 19).
Abnormal data (also called erroneous or invalid data) is data that the program should reject because it is the wrong type, format, or simply outside the valid range.
For an age field, abnormal data might include:
"F" (a letter, wrong type).-5 (negative, impossible).200 (far outside the valid range)."" (empty input)."@" (a symbol).A well-written program does not crash on abnormal input; it shows an error message and asks the user to try again.