Testing
A test plan is prepared before any testing begins. It records every check you intend to make, which helps you cover all cases and remember to deal with any fault you uncover.
Writing the plan first forces you to think through every case in advance, instead of typing in whatever comes to mind once the program runs.
After each test is performed, write the actual result — what happens when the test is run — next to the expected one, then note whether it passed and anything that must be done. If the two results agree, the test has passed. If they do not, the plan identifies the test that failed so you can correct the fault and try again.
For normal and boundary data the expected result is usually that the data is accepted. For invalid and erroneous data the expected result is usually that the program rejects the data and may ask for it to be entered again.
| Test | Purpose | Test data | Type of test data | Expected result | Actual result |
|---|---|---|---|---|---|
| 1 | check a typical bike hire | 5 | normal | accepted, charged for 5 hours | 5 hours charged — pass |
| 2 | check the longest allowed hire | 12 | boundary | accepted, charged for 12 hours | 12 hours charged — pass |
| 3 | check a hire longer than allowed | 13 | invalid | rejected, asked to re-enter | 13 hours accepted — fail, fix needed |
| 4 | check text is rejected | blue | erroneous | rejected, asked to re-enter | rejected — pass |
OCR GCSE Computer Science · Testing