AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    If the allowed range is 1 to 10, then boundary data is 0, 1, 10, 11, ie…

    Full specification wording

    Robust and secure programming: If the allowed range is 1 to 10, then boundary data is 0, 1, 10, 11, ie either side of the allowed boundary.

    This statement gives a worked example of boundary value analysis.

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

    • Point 7 of 14

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    This statement gives a worked example of boundary value analysis. The allowed range is 1 to 10 inclusive, so the lowest accepted value is 1 and the highest is 10. Boundary data tests the edges: 1 and 10 are the valid boundaries, while 0 and 11 are the invalid values immediately outside. Together the set is 0, 1, 10 and 11, that is, either side of each allowed boundary. The purpose is to catch off-by-one errors, where a comparison such as a greater-than-or-equal test is written incorrectly and wrongly rejects 1 or wrongly accepts 11. To apply this, state the range, identify its two limits, then step one unit below the lower limit and one unit above the upper limit. Values such as 5 are normal data inside the range, not boundary data. When answering, list all four values and label each as valid or invalid.

    What earns the marks

    • States that for the range 1 to 10 the valid boundaries are 1 and 10.
    • Gives 0 as the invalid value immediately below the lower boundary.
    • Gives 11 as the invalid value immediately above the upper boundary.
    • Presents the complete boundary set as 0, 1, 10 and 11.
    • Explains that these values test either side of each allowed boundary to expose off-by-one comparison errors.
    • Labels 1 and 10 as valid and 0 and 11 as invalid for the stated range.

    Common mistakes and how to put them right

    • Giving only 1 and 10 as the boundary data.

      Put it right: The values immediately outside the range, 0 and 11, must also be included.

    • Choosing values far outside the range such as -5 or 50.

      Put it right: Boundary data sits exactly one step beyond each limit, so 0 and 11 are correct here.

    • Including an interior value such as 5 as boundary data.

      Put it right: 5 is normal data inside the range, not a boundary value.

    Exam tips

    • Write the range and its two limits first, then derive the outside values by subtracting one and adding one.
    • Annotate each value as valid or invalid so the reasoning behind the boundary set is visible.
    • Check the step size: move exactly one unit beyond each limit, not an arbitrary amount.

    Try the lesson

    The start of the Robust and secure programming: If the allowed range is 1 to 10, then boundary data is 0, 1, 10, 11, ie either side of the allowed boundary. lesson, made from checked teaching notes for this specification point.

    Have a go first

    A program accepts a whole number from 1 to 10 inclusive. Which value is boundary data that lies just outside the allowed range?

    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: If the allowed range is 1 to 10, then boundary data is 0, 1, 10, 11, ie either side of the allowed boundary.

    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