Testing (Verification)

Jargon: we test to find if a bug exists. We debug to find the location of a known bug.

Testing Techniques

Black Box (functional) testing

White Box (code-based) testing

The programmer looks at the code, and tries to ensure coverage

Exhaustive testing

...is not possible. There are too many combinations of inputs. Dijkstra:
'Testing can only reveal the presence of bugs, not their absence'
In other words, we can never know when we have found the last bug.

We can use 'equivalence partitioning' to represent a 'run' of data by one item. For example, the ages 18 to 59 might be represented by e.g. 30 in a particular program.

Static Verification (no code is run)

walkthroughs, inspections

...are reviews in which a group of people 'walk through' documents. An inspection is more formal, but a walkthrough may only involve the team of programmers.

The Stages of Testing

Unit testing - avoids 'big bang'

System testing

We fit together all the unit-tested stuff, in a systematic way

Acceptance Testing

You will also hear of 'beta testing', where a product is released early to selected customers.

Which approach is best?

Studies show that different approaches find different errors - hence might use a combination of e.g white box and walkthrough for unit tests.

Summary

testing is crucial, and costly - recall our other lecture on the stages/costs in life-cycle.