Why do we test?
Checking a program works, and when to check it.
Why do we test?
When do we test?
Key facts
| Type of testing | When | What is tested |
|---|---|---|
| Iterative testing | During development | Each module, as it is written. It is repeated. |
| Final (terminal) testing | At the end, before release | The whole program, with all the modules joined |
ActivitySort it: iterative or final?
ActivityWhy do we test?
Syntax and logic errors
Two types of error. One stops the program. One does not.
Two types of error
Key facts
| Syntax error | Logic error | |
|---|---|---|
| Does the program run? | No | Yes |
| Is the output correct? | There is no output | No, it is unexpected |
| Example | pritn("Hi") or a missing bracket | - used instead of + |
ActivityBug hunt
ActivityFix the line
Test data
Choosing data to test with.
A mark from 0 to 100
Key facts
| Type | What it is | Accepted? | Mark 0 to 100 |
|---|---|---|---|
| Normal | Should be accepted without causing errors | Yes | 56 |
| Boundary | Correct type, on the very edge of being valid | Yes | 0 and 100 |
| Invalid | Correct data type, but should be rejected | No | 150 |
| Erroneous | Wrong data type, should be rejected | No | "ninety" |
Boundary data is the lowest and highest values that are allowed. Invalid data is a value outside the range, such as 150.
Test data can be used with any validation check, such as a range check or a length check.
ActivitySort it: which test data?
ActivityPick the test data
Test plans and refining
Test it, fix it, test it again.
Run the test plan
Key facts
| Column | What goes in it |
|---|---|
| Test data | The value to test with |
| Type of test data | Normal, boundary, invalid or erroneous |
| Expected result | What should happen. It is worked out before the test. |
| Actual result | What did happen. Compare it with the expected result. |
ActivityComplete the test plan
Exam questions
Type your answer, then mark it against the mark scheme.
Challenges
Test yourself! Answer 10 questions correctly to finish this step.