Learn
7.6.2 | EXTREME AND BOUNDARY TEST DATA
01 | ORDINARY INPUT CAN MISS A SMALL ERROR
A form accepts whole-number marks from zero to fifty inclusive. You test 34 and the program accepts it. So far, so good.
But suppose the condition is accidentally written as Mark > 0 AND Mark < 50. Thirty-four still passes, so that normal test does not reveal the error. Zero and fifty would be rejected even though the requirements allow them.
Testing close to the limits is valuable because that is where a small change in a comparison can change acceptance into rejection.
The Cambridge syllabus distinguishes extreme and boundary data. Extreme data uses the smallest and largest accepted values. Boundary data includes those accepted endpoints and the corresponding nearest rejected values.
We will use that distinction throughout this lesson rather than treating the two labels as interchangeable.
02 | IDENTIFY THE ACCEPTED DOMAIN FIRST
A domain is the set of values permitted or considered by a rule. For this mark field, it is the whole numbers from zero to fifty.
Inclusive means the endpoint is accepted. The comparisons >= 0 and <= 50 include zero and fifty.
The type matters as well as the limits. Whole-number inputs move in steps of one, so −1 is the nearest lower rejected integer and 51 is the nearest upper rejected integer.
If the field instead accepted values in tenths, the nearby candidates would be different. Do not choose test spacing before knowing the input type and permitted precision.
Start by stating the rule precisely. “A mark between zero and fifty” can be ambiguous in ordinary language; “a whole-number mark from zero to fifty inclusive” gives a clear test expectation.
03 | EXTREME DATA: ACCEPTED ENDPOINTS
Extreme test data is the smallest and largest acceptable value under the rule. For the whole-number mark range, these values are 0 and 50.
Both should pass. Extreme does not mean an enormous number such as one million or a very negative number such as −999. Those are outside this accepted range.
| Extreme input | Expected | Reason |
|---|---|---|
| 0 | Accept | Smallest accepted whole-number mark |
| 50 | Accept | Largest accepted whole-number mark |
An extreme test asks whether the implementation correctly accepts the edge of what is allowed. This detects conditions that are too restrictive.
For a quantity from one to twenty inclusive, the extreme values are 1 and 20. The definition stays the same; the values change with the requirements.
04 | BOUNDARY DATA: TEST BOTH SIDES OF EACH EDGE
For this Cambridge syllabus, boundary data includes the smallest and largest accepted values and the corresponding nearest rejected values.
At the lower edge of our whole-number mark range, test −1 and 0. At the upper edge, test 50 and 51.
LOWER EDGE
REJECT
ACCEPT
−1 is just below the smallest accepted integer.
UPPER EDGE
ACCEPT
REJECT
51 is just above the largest accepted integer.
The lower pair checks the change from reject to accept. The upper pair checks the change from accept to reject.
| Boundary input | Expected | Role |
|---|---|---|
| -1 | Reject | Nearest lower rejected integer |
| 0 | Accept | Smallest accepted integer |
| 50 | Accept | Largest accepted integer |
| 51 | Reject | Nearest upper rejected integer |
Zero and fifty are therefore extreme values and also belong in the boundary set. The categories overlap at the accepted endpoints; boundary testing adds the nearby rejected values.
Do not omit those rejected neighbours when asked to supply the full boundary set for this integer rule.
05 | MAKE THE EXPECTED RESULT PART OF THE TEST
A list of four numbers is not a complete test plan. State why each value was chosen and what the system should do.
For −1, expect controlled rejection with the required message and retry. For 0, expect acceptance and use of zero. For 50, expect acceptance and use of fifty. For 51, expect rejection.
If the form stores marks, rejected values must not replace a valid stored mark. Accepted values should be stored against the intended student.
A test passes when its actual behaviour matches its expected behaviour. Correct rejection of −1 is a passing test, not a failure merely because the input was rejected.
Record actual observations only after running the implementation. The example tables here specify expectations or explicitly illustrated results.
06 | WATCH THE COMPARISON ERROR BECOME VISIBLE
Compare the correct rule with the buggy one. The correct acceptance condition includes equality at both ends.
// Correct for an inclusive range Accepted ← Mark >= 0 AND Mark <= 50 // Buggy: excludes both accepted endpoints Accepted ← Mark > 0 AND Mark < 50
For 34, both conditions are true. For 0, the correct lower comparison is true but the strict comparison is false. For 50, the correct upper comparison is true but the strict comparison is false.
| Mark | Correct inclusive rule | Buggy strict rule |
|---|---|---|
| -1 | Reject | Reject |
| 0 | Accept | Reject: fault revealed |
| 34 | Accept | Accept |
| 50 | Accept | Reject: fault revealed |
| 51 | Reject | Reject |
This explains why ordinary interior data can miss the error while extreme data reveals it.
Rejected neighbours detect a different fault: a rule that accidentally allows too much. Changing the lower accepted bound to −1 or the upper accepted bound to 51 would incorrectly accept one of those boundary tests.
07 | CHOOSE THE FOUR VALUES FOR A NEW RANGE
A canteen quantity must be an INTEGER from 1 to 20 inclusive. The smallest accepted value is 1 and the largest is 20.
The nearest rejected integers are 0 below the lower edge and 21 above the upper edge. The extreme set is 1 and 20; the boundary set is 0, 1, 20 and 21.
| Input | Expected | Boundary role |
|---|---|---|
| 0 | Reject | Just below accepted range |
| 1 | Accept | Lower accepted extreme |
| 20 | Accept | Upper accepted extreme |
| 21 | Reject | Just above accepted range |
A normal interior value such as 8 remains useful for checking ordinary operation. A far-out abnormal value such as 100 remains useful for broader range rejection. They answer different testing questions.
Choose values from the scenario rather than memorising zero and fifty. The reasoning is reusable even when the endpoints are not.
08 | EXCLUSIVE WORDING CHANGES THE ACCEPTED ENDPOINT
A form accepts whole-number ages greater than 12 and less than 18. The numbers named in the rule, 12 and 18, are excluded.
The smallest accepted integer is 13 and the largest is 17. Those are the extreme values. The boundary pairs are 12 with 13 and 17 with 18.
Compare that with “from 12 to 18 inclusive”, whose extremes would be 12 and 18 and whose full integer boundary set would be 11, 12, 18 and 19.
Terms such as “at least” and “at most” include equality. “More than” and “less than” exclude equality. Translate the wording into comparisons before choosing tests.
Do not simply take every number appearing in a sentence as an accepted extreme. Determine the actual smallest and largest values that pass.
09 | LENGTH RULES HAVE BOUNDARIES TOO
A text field permits from two to six characters inclusive. Character counts are whole numbers, so the extreme lengths are two and six.
The boundary lengths are one, two, six and seven. Supply actual strings with those lengths when asked for test data, not merely the length numbers.
| Input text | Length | Expected |
|---|---|---|
| A | 1 | Reject |
| AB | 2 | Accept |
| ABCDEF | 6 | Accept |
| ABCDEFG | 7 | Reject |
The example strings use only letters so we can focus on length. If the field also has a character-pattern rule, make your length-test strings satisfy that other rule where possible.
For a field requiring exactly six characters, there is one accepted length, six. The neighbouring rejected lengths are five and seven. The lower and upper accepted lengths coincide; you do not need to invent two different accepted lengths.
10 | DECIMAL DATA NEEDS STATED PRECISION
Suppose a measurement must be from 0.0 to 10.0 inclusive, and the input specification allows one decimal place. The step is 0.1, so use −0.1, 0.0, 10.0 and 10.1 for the boundary set.
The extreme values are 0.0 and 10.0. The nearby rejected values differ by one permitted input step.
If the specification allows two decimal places, −0.01 and 10.01 are closer rejected candidates. A rule permitting arbitrarily precise real values does not have a unique immediately adjacent real value.
For such a rule, state the precision assumption or choose justified nearby out-of-range values according to the representation being tested. Do not claim that 0.1 is the universal neighbour for every REAL field.
Most simple exam examples make the type or precision clear. Use it explicitly in your reasoning.
11 | TEST EACH RULE WITHOUT ACCIDENTAL DISTRACTIONS
If you want to test a range check, use values of the required type. Entering the text “fifty-one” may exercise type handling rather than the numeric upper boundary.
If you want to test a length edge, use permitted characters. A seven-character string containing a forbidden symbol might fail its format before the length behaviour is observed.
In a full system, several checks can run together. Record the order and messages where relevant, and ensure the expected result matches the intended test purpose.
A test should let you explain which rule is being exercised. You can also have combined-invalid tests, but label them as such rather than assuming their result isolates one condition.
12 | STARTING STATE CAN CREATE A DECISION BOUNDARY
Not every important limit belongs to the newly entered field. A booking decision depends on stored state.
For capacity three, test a new valid identifier when two places are booked: it should be accepted. Test it in a separate starting state with three places booked: it should be rejected as full.
The booking count changes the decision at capacity. Both identifier inputs can be perfectly valid; the cases exercise the availability boundary in the processing logic.
Describe these as state-dependent decision tests. If an exam asks specifically for boundary data for an input field, provide values tied to that field’s stated range rather than replacing them with unrelated state examples.
Record independent starting states so acceptance in one test does not accidentally change the setup of another.
13 | COMPARE ALL FOUR DATA CATEGORIES
The same mark requirement can be tested in several complementary ways.
| Category | Values | Testing purpose |
|---|---|---|
| Normal | 34 | Ordinary valid input |
| Abnormal | 500 | Clearly out-of-range input |
| Extreme | 0 and 50 | Accepted endpoints |
| Boundary | -1, 0, 50 and 51 | Accepted endpoints and nearest rejected integers |
An endpoint such as zero is valid and more specifically extreme. It also belongs in the boundary set. A nearby rejected integer such as −1 is abnormal and specifically a rejected boundary neighbour.
These labels describe why particular values are useful; they are not necessarily mutually exclusive boxes. In an answer asking for each category, make the distinction visible with ordinary normal data, a clearly far-out abnormal value, accepted extremes and the full boundary set.
Passing a finite set of tests gives evidence about those cases, not proof of every possible behaviour.
14 | EXPLAIN WHY THE VALUES ARE SUITABLE
A clear extreme-data answer is: “Use zero and fifty because they are the smallest and largest permitted whole-number marks, so both should be accepted.”
A clear boundary answer is: “Use minus one and zero at the lower limit, and fifty and fifty-one at the upper limit. These test the transition between rejected and accepted integer values.”
For an explain question, connect the test to the possible fault: “Testing zero reveals an incorrect greater-than-zero condition because that condition excludes a permitted endpoint.”
You should now be able to identify actual accepted endpoints, choose the nearest rejected values using the specified data type, and predict outcomes before running a test. The next lesson records these choices in complete test plans.