CIE AS & A Level Computer Science, section 12.3 (Program testing and maintenance)
Methods of testing
| Method | Description |
|---|---|
| Dry run | testing the algorithm by hand with a trace table |
| Walkthrough | a group of people (often including the author) read through the code or design together to find faults |
| White-box testing | the tester can see the code and chooses data so that every path and statement is tested |
| Black-box testing | the tester knows only the inputs and expected outputs, not the code. It tests that the program does what it should |
Stages of testing
| Stage | Purpose |
|---|---|
| Stub testing | a stub is a simple dummy module used in place of a module that is not yet written, so the calling part can be tested |
| Integration testing | modules are combined and tested together to check they work as a group |
| Alpha testing | testing by the developer's own team in-house |
| Beta testing | testing by a selected group of real users outside the company, before the final release |
| Acceptance testing | the customer tests the system to confirm it meets their requirements, before accepting it |
Choosing
- A tester who writes the code and knows its structure uses white-box testing.
- A customer checking the final system uses black-box (acceptance) testing, because they care only about the results.
- A game company releasing a new app might use beta testing to find faults on many different devices.
Important
Testing can show that errors exist but cannot prove there are none. The aim is to test enough, with well-chosen data.
Common mistake: confusing alpha and beta testing. Alpha is done inside the company; beta is done by real users outside it. Also, white-box testing is about the code paths, while black-box is about the inputs and outputs.
Exam tip: for each method, state who does it and what is tested. Match the stage to the situation, such as "acceptance testing by the customer to confirm it meets the requirements".
Check yourself
What is the difference between white-box and black-box testing?
White-box testing uses knowledge of the code to test its paths; black-box testing checks inputs against expected outputs without looking at the code.
What is beta testing?
Testing by a selected group of real users outside the development team, before the final release.
What is a stub used for?
A simple dummy module that replaces one not yet written, so the rest of the program can be tested.