Revision Notes
Cambridge A Level Computer Science (9618): Program Testing and Maintenance – Revision Notes
Revision notes for 9618 section 12.3: error types, the nine testing methods, test plan contents, test data, maintenance types and a self-test.
- Subject
- Computer Science
- Level
- AS LEVEL
- Topic
- Topic 12: Software Development
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to Cambridge A Level Computer Science (9618), 2026. Official specification .
Syllabus page (what it covers and how it is assessed): Cambridge A Level Computer Science.
Syllabus points this page covers
9618 (AS Level)
- 12.3 Program Testing and Maintenance
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (9618).
Condensed notes for 12.3 Program Testing and Maintenance, AS content in Cambridge International AS & A Level Computer Science 9618, examined in Paper 2. You need ways of avoiding and exposing faults, the three error types, the named testing methods, test strategies and plans, test data, the three types of maintenance, and the skill of amending an existing program.
Related: Program Testing and Maintenance study guide · Program Testing and Maintenance practice questions · Software Development revision notes (all of Topic 12)
Avoiding and exposing faults
- Avoid: design first; modular code; meaningful names, comments, indentation; tested library routines; input validation; local variables.
- Expose: planned testing with chosen data; dry runs; walkthroughs; alpha and beta testing by others.
Error types
| Type | Program runs? | How found | Classic example |
|---|---|---|---|
| Syntax | No; translation fails | Translator error messages | Misspelt keyword, missing ENDIF |
| Logic | Yes, wrong output | Testing, dry run | Wrong operator, wrong loop limit |
| Run-time | Starts, then fails | Testing with particular data | Divide by zero, index out of bounds |
Testing methods in one line each
- Dry run: trace the code by hand, recording variables in a trace table.
- Walkthrough: the programmer explains the code step by step to others, who look for errors.
- White-box: test every path using knowledge of the code.
- Black-box: test inputs against expected outputs without seeing the code.
- Stub: a dummy module returns fixed values so callers can be tested.
- Integration: test separately tested modules once combined.
- Alpha: in-house testing near completion.
- Beta: testing by selected real users before release.
- Acceptance: the client confirms the program meets the requirements.
Strategy and plan
- Test strategy: the overall approach; which methods, in which order, by whom, when.
- Test plan contents: test number; purpose; test data; type of data; expected result; actual result; action taken.
- Write expected results from the specification before running the tests.
Test data (example: a whole number from 1 to 20)
| Type | Values | Expected |
|---|---|---|
| Normal | 7, 15 | Accepted |
| Extreme | 1, 20 | Accepted |
| Boundary | 0 and 1; 20 and 21 | 0 and 21 rejected, 1 and 20 accepted |
| Abnormal | −4, 35, “six” | Rejected |
Maintenance types
| Type | Trigger | Example |
|---|---|---|
| Corrective | A fault found in use | Wrong total for some inputs |
| Adaptive | A change in the environment or rules | New operating system, new tax law |
| Perfective | A wish to improve | Faster search, extra feature |
Amending a program
- Read the existing code and find where the change must go.
- Identify every path affected, including how loops can now end.
- Make the change and rewrite the whole affected section.
- Retest the old behaviour and the new behaviour.
Locating and correcting an error: method
- Run the test and compare the actual result with the expected one.
- Dry run the suspect section with the same data, one row per statement, until a variable first takes a wrong value.
- Name the error type and quote the line.
- Correct the line, then rerun the failed test and the earlier passing tests.
Example: a loop FOR I ← 1 TO 9 meant to total ten values gives a total missing the last value; the dry run shows I never reaches 10, so this is a logic error, corrected to FOR I ← 1 TO 10.
Key terms
| Term | Meaning |
|---|---|
| Fault | An error in a program that causes it to behave incorrectly |
| Trace table | A table recording variable values as each statement is executed |
| Stub | A simple placeholder module used during testing |
| Test strategy | The overall plan for how a program will be tested |
| Test plan | The list of tests with data and expected results |
| Abnormal data | Data that should be rejected |
| Extreme data | The largest and smallest values that should be accepted |
| Boundary data | Values just inside and just outside a limit |
Exam traps
- A crash is a run-time error, not a logic error.
- A dry run is done alone with a trace table; a walkthrough involves explaining to others.
- Black-box does not look at the code; white-box does.
- Beta testers are outside users; alpha testers are in-house.
- Test data without expected results scores poorly.
- Adaptive is not “fixing bugs”; that is corrective.
Self-test
- What type of error is a missing ENDIF?
- A program outputs 9 instead of 10 for a total. What type of error is this likely to be?
- Give a cause of a run-time error.
- State the difference between a dry run and a walkthrough.
- Which testing method uses knowledge of the code?
- What is a stub used for?
- Who carries out acceptance testing?
- List four items in a test plan.
- A field accepts 10 to 50. Give the two extreme values.
- For the same field, give boundary data for the upper limit.
- A program must be changed because the company moves to a new database system. Which maintenance type is this?
- State two ways of avoiding faults when writing code.
Answers: 1. Syntax error. 2. A logic error, such as a loop running one time too few. 3. Any one: dividing by zero; an array index outside its bounds; reading past the end of a file. 4. A dry run is a hand trace of the code using a trace table; a walkthrough is the programmer explaining the code step by step to others, who check it. 5. White-box testing. 6. To stand in for a module not yet written, returning fixed values, so the module that calls it can be tested. 7. The client (or users acting for the client). 8. Any four: test number, purpose, test data, type of data, expected result, actual result, action taken. 9. 10 and 50. 10. 50 (accepted) and 51 (rejected). 11. Adaptive. 12. Any two: design before coding; use modules; meaningful identifiers and comments; use tested library routines; validate input; use local variables.
Related resources
-
Practice questions
Cambridge A Level Computer Science (9618): Software Development – Practice Questions
Questions with answers on life cycle models, structure charts, state-transition diagrams, errors, testing, test data and maintenance for Cambridge 9618.
Computer Science · Cambridge · AS Level
Try questions -
Revision notes
Cambridge A Level Computer Science (9618): Software Development – Revision Notes
Revision notes on waterfall, iterative and RAD, structure charts, state-transition diagrams, error types, testing methods and maintenance for Cambridge 9618.
Computer Science · Cambridge · AS Level
Revise topic -
Study guides
Cambridge A Level Computer Science (9618): Software Development – Study Guide
AS study guide to the program development life cycle, development models, program design tools, test data, test plans and maintenance for Cambridge 9618.
Computer Science · Cambridge · AS Level
Read guide
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.