AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Robust and secure programming: boundary (extreme)

    Boundary (extreme) data are the values at the very edges of an accepted range, where errors most often occur.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 9 of 14

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Boundary (extreme) data are the values at the very edges of an accepted range, where errors most often occur. For a field accepting ages 11 to 18 inclusive, the boundary values are 11 and 18, plus the values just outside the range, 10 and 19, which should be rejected. Testing boundaries checks that comparison operators such as greater-than-or-equal and less-than-or-equal are written correctly, because an off-by-one error shows up at the edge but not in the middle. A sound method is to test the lowest valid value, the highest valid value, and one value just below and just above the range, predicting the expected output for each before running the program. Boundary data is distinct from normal data (values well inside the range) and from general erroneous data (values clearly invalid). Choosing the exact edge values, rather than approximate ones, is what makes the test meaningful.

    What earns the marks

    • Boundary (extreme) data are the values at the very edges of an accepted range.
    • For a range of 11 to 18 inclusive, the boundary values are 11 and 18, with 10 and 19 just outside the range.
    • Boundary testing checks that comparison operators and range checks are written correctly, catching off-by-one errors.
    • A sound method tests the lowest valid value, the highest valid value, and one value just below and just above the range.
    • The expected output for each boundary value should be predicted before running the program and then compared.
    • Boundary data is distinct from normal data (well inside the range) and from general erroneous data (clearly invalid).

    Common mistakes and how to put them right

    • Testing only a value in the middle of the range and calling it a boundary test.

      Put it right: , boundary tests use the exact edge values and the values just outside the range.

    • Forgetting the values just outside the range.

      Put it right: , include one value below the minimum and one above the maximum to check rejection.

    • Assuming boundary values are always invalid.

      Put it right: , the lowest and highest valid values are boundary values that should be accepted, while the values just outside should be rejected.

    • Not predicting the expected output for each boundary value.

      Put it right: , state in advance whether each value should be accepted or rejected and what result is expected.

    Exam tips

    • State the exact edge values and the values immediately outside the range, and say for each whether it should be accepted or rejected.
    • Explain that boundary testing targets off-by-one errors in comparison operators, which is why the edges matter more than the middle.
    • Predict the expected output for each boundary value before describing the test so a wrong result can be identified.

    Try the lesson

    The start of the Robust and secure programming: boundary (extreme) lesson, made from checked teaching notes for this specification point.

    Have a go first

    A program stores a test score in a variable that is only allowed to hold whole numbers from 0 to 100 inclusive. A user enters the value 101. Which type of test data is 101 for this variable?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Robust and secure programming: boundary (extreme)

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge