Test data Cambridge IGCSE Computer Science (9–1) revision

Not started

Learn it

In plain words

A program that works for one sensible input has not been tested. Testing means trying to break it: with ordinary values, with silly values, and above all with values right on the edge of what is allowed.

5 things to know

  1. Normal data is typical data that the program should accept.
  2. Abnormal data is data that the program should reject: the wrong type, or a value outside the limits.
  3. Extreme data is the largest and the smallest value that should be accepted.
  4. Boundary data is the largest or smallest acceptable value together with the nearest value that should be rejected.
  5. Each test should state the data, the type of test data, and the result expected.

Worked example

A program accepts whole-number marks from 0 to 100. Suggest test data of each type.

  1. Normal: 57. It should be accepted.
  2. Abnormal: 150, or the word "ten". Each should be rejected.
  3. Extreme: 0 and 100. Both should be accepted.
  4. Boundary: 100 and 101 at the top (accepted, then rejected), and 0 and −1 at the bottom.

Tips and tricks

  • Extreme data is still accepted. It sits on the limit, inside it. Boundary data is a pair: one each side of the limit.
  • Give actual values that suit the question, and say whether each should be accepted or rejected.
5 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Test data: 5 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. What is normal test data?
    • data that should be rejected
    • typical data that should be accepted (the answer)
    • the largest value allowed
    • data of the wrong type

    It checks that the program works in ordinary use.

  2. A program accepts numbers from 1 to 50. Which is abnormal data?
    • 1
    • 25
    • 50
    • 75 (the answer)

    It is outside the range and should be rejected.

  3. A program accepts numbers from 1 to 50. Which is extreme data?
    • 0
    • 25
    • 50 (the answer)
    • 51

    It is the largest value that should be accepted.

  4. A program accepts numbers from 1 to 50. Which pair is boundary data?
    • 25 and 26
    • 50 and 51 (the answer)
    • 2 and 49
    • 0 and 100

    The last value accepted and the first value rejected.

  5. Why is a program tested with abnormal data?
    • to make it run faster
    • to check that it rejects data it should not accept (the answer)
    • to fill up its memory
    • to check its spelling

    A good program copes with wrong input.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf