Program testing and maintenance

Computer Science AS · Software development. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science AS topics

The idea

There are three kinds of error. A syntax error breaks the rules of the language and is found before the program runs. A logic error lets the program run but gives a wrong result. A run-time error makes the program stop while it is running, for example on division by zero.

Testing is planned. A test strategy states which testing methods are used and when. A test plan lists every test with its data, the type of data and the expected result. Test data is chosen as normal, abnormal and extreme or boundary.

A program in use still needs maintenance: corrective, adaptive or perfective.

Rules to remember

Common mistake

Treating extreme data as invalid. Extreme values are the largest and smallest values that must still be accepted; abnormal values are the ones that must be rejected.

Worked example

A program accepts whole-number ages from 11 to 18 inclusive. Classify the test values 14, 18, 19 and "abc".

  1. 14 is well inside the range, so it is normal data and is accepted.
  2. 18 is the largest valid value, so it is extreme data and is accepted.
  3. 19 is just outside the limit, so it is rejected: abnormal, and with 18 it tests the boundary.
  4. "abc" is the wrong data type, so it is abnormal data and is rejected.

Answer: 14 normal, 18 extreme, 19 abnormal (boundary, rejected), "abc" abnormal

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Program designTake a Computer Science AS test