Worked example 1
A program includes a function CheckDiscount(Age) that returns TRUE if a person is eligible for a discount and FALSE otherwise. The discount is available for ages 18 to 25 inclusive. Complete a test plan with four distinct test cases for this function.
Show solution outline
Here is a sample test plan. Note the justification for each data choice.
| Test Case | Test Data (Age) | Type of Data | Expected Outcome | Actual Outcome | Justification |
|---|---|---|---|---|---|
| 1 | 20 | Normal | TRUE | A typical valid age within the range. | |
| --- | --- | --- | --- | --- | |
| 2 | 18 | Boundary | TRUE | The lowest valid value in the range. | |
| 3 | 26 | Boundary | FALSE | The first invalid value just above the upper limit. | |
| 4 | 'nineteen' | Abnormal | Error message / FALSE | Data of the wrong type (string instead of integer). |