CIE IGCSE | 7.6.2 Extreme and Boundary Test Data

Lesson objective

Distinguish extreme and boundary data using Cambridge definitions, select precise values at acceptance limits and predict the required outcomes.

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 data is acceptable data
Extreme inputExpectedReason
0AcceptSmallest accepted whole-number mark
50AcceptLargest 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

−1

REJECT

0

ACCEPT

−1 is just below the smallest accepted integer.

UPPER EDGE

50

ACCEPT

51

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.

Four values exercise both sides of the two limits
Boundary inputExpectedRole
-1RejectNearest lower rejected integer
0AcceptSmallest accepted integer
50AcceptLargest accepted integer
51RejectNearest 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.

Normal interior input alone misses the endpoint error
MarkCorrect inclusive ruleBuggy strict rule
-1RejectReject
0AcceptReject: fault revealed
34AcceptAccept
50AcceptReject: fault revealed
51RejectReject

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.

INTEGER quantity from one to twenty inclusive
InputExpectedBoundary role
0RejectJust below accepted range
1AcceptLower accepted extreme
20AcceptUpper accepted extreme
21RejectJust 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.

Text length from two to six inclusive
Input textLengthExpected
A1Reject
AB2Accept
ABCDEF6Accept
ABCDEFG7Reject

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.

Whole-number marks from zero to fifty inclusive
CategoryValuesTesting purpose
Normal34Ordinary valid input
Abnormal500Clearly out-of-range input
Extreme0 and 50Accepted endpoints
Boundary-1, 0, 50 and 51Accepted 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.

IDENTIFY THE LIMIT OR DATA ROLE

Terminology

Terminology

Extreme test data

The smallest and largest acceptable values under the specified rule.

Boundary test data

Accepted endpoints and the corresponding nearest rejected values, using the specified type and precision.

Accepted endpoint

A smallest or largest permitted value.

Rejected neighbour

The nearest permitted-to-supply value just outside an acceptance limit.

Inclusive limit

A limit at which equality is accepted.

Exclusive limit

A named limit at which equality is excluded.

Lower boundary pair

Values on the rejected and accepted sides of the lower edge.

Upper boundary pair

Values on the accepted and rejected sides of the upper edge.

Domain

The set of values considered or allowed by a rule.

Input step

The difference between neighbouring representable inputs under a stated precision.

Precision

The permitted level of numeric detail, such as one decimal place.

Off-by-one error

A mistake that incorrectly includes or excludes one position or integer value.

Expected result

The outcome specified before a test run.

Actual result

The observed behaviour of a test run.

Normal test data

Ordinary valid data exercising typical operation.

Abnormal test data

Data failing specified acceptability rules.

State-dependent test

A test whose outcome depends on stored values or starting conditions.

Test coverage

The rules and paths exercised by the chosen cases.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which are extreme values for whole-number marks zero to fifty inclusive?
2. Which is the complete integer boundary set for that rule?
3. A buggy condition uses Mark > 0 AND Mark < 50. Which accepted inputs reveal the fault?
4. Which are extremes for whole-number ages greater than twelve and less than eighteen?
5. Text length must be two to six inclusive. Which boundary lengths should be tested?
6. Which statements about overlap are correct?
7. Which is appropriate for measurements zero to ten inclusive at one decimal place?
8. Which make boundary tests useful?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Compare extreme and boundary data using the Cambridge definitions.

2. Give extreme and boundary values for an integer quantity from one to twenty inclusive.

3. Explain why testing thirty-four alone misses a strict-comparison bug in the zero-to-fifty rule.

4. Explain why zero and fifty are both extreme and boundary data.

5. Give the boundary set for whole-number ages greater than twelve and less than eighteen.

6. Suggest actual strings for a text length from two to six inclusive.

7. Explain why decimal precision matters when choosing rejected neighbours.

8. Explain why correctly rejecting a boundary neighbour is a passing test.

DESIGN IT | TWO DIFFERENT BOUNDARIES

A required quantity is an INTEGER from five to twelve inclusive. A comment length must be from three to eight characters inclusive. For each rule, state the extremes and full boundary set, supply actual data and record expected acceptance or rejection. Explain which test detects an accidental strict upper comparison.

Reveal a possible plan

Quantity extremes: five and twelve. Boundary cases: four reject, five accept, twelve accept, thirteen reject. Length extremes: three and eight. Actual strings: AB (two, reject), ABC (three, accept), ABCDEFGH (eight, accept), ABCDEFGHI (nine, reject). A quantity of twelve or a string of length eight reveals an incorrect strict upper comparison excluding the permitted endpoint.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for 7.6.2 Extreme and Boundary Test Data is coming soon. Complete the matching task and written questions in your exercise book.