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.

In simpler words

There are three kinds of error. A syntax error breaks the rules of the language. A logic error runs but gives a wrong answer. A run-time error crashes the program. Testing is planned. Test data should be normal, abnormal, extreme and boundary values. After release, programs still need fixing, updating for new needs, or improving.

An everyday comparison

Testing a program is like testing a lift. Normal data is a few people. Extreme data is exactly the weight limit, which must still work. Abnormal data is far over the limit, which must be refused. Boundary data checks values each side of the limit. The comparison stops working because programs can also have syntax errors, which stop them running at all.

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.

In the exam

Name the error type and give a specific example from the code. For test data, state the value, its type and the expected result, for example: 100, extreme, accepted. Remember that extreme data is valid and must be accepted. Match testing methods to the situation: white-box tests every path, black-box tests inputs against outputs, alpha is in-house, beta is with real users, acceptance is by the client. For maintenance, name the type and link it to the reason.

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