Testing

<< Previous: Defensive design Next: Producing robust programs test >>

Iterative and final testing

Testing is essential to ensure a program behaves as expected. As sub-programs are developed, they will be tested to ensure that they work as expected. This is known as iterative testing and may also involve limited models of the final program to ensure sub-programs interact as expected. Once the whole program is created, final testing ensures that the modules work together so that the program behaves as expected and meets its objectives.

Types of errors

The two types of errors you need to be familiar with identifying through testing are:



The code below is meant to output the average of all the numbers in an array called scores.



The first is a logic error as it fails to include the first item in the array but the code would still run. The second is a syntax error. In trying to concatenate a string and a real number it breaks the rules of the progamming language throwing up an erro that prevents the code from running.

Types of test data

There are 4 types of test data to be familiar with:



Example



Test plan

A suitable test plan will cover normal, boundary, invalid and erroneous data. A test plan generally includes:



Knowledge check


Questions:
Correct:

Question text


<< Previous: Defensive design Next: Producing robust programs test >>

© All materials created by and copyright S.Goff