lnf.cymru stimulus sheet · Computer Science · Year 11
The cinema, the program and Ifan are invented. This is practice with an invented program. It is not assessed work.
Sinema Aberlliw, a small community cinema, wants a program that tells customers the price of a ticket.
| Customer | Ticket price |
|---|---|
| Under 12 | £5.50 |
| 65 and over | £6.00 |
| Everyone else | £8.50 |
| Test | Type | Input | Expected | Actual | Result |
|---|---|---|---|---|---|
| 1 | Typical | 30 | £8.50 | £8.50 | Pass |
| 2 | Boundary | 11 | £5.50 | £5.50 | Pass |
| 3 | Boundary | 12 | £8.50 | £8.50 | Pass |
| 4 | Boundary | 65 | £6.00 | £8.50 | Fail |
| 5 | Extreme | 100 | £6.00 | £6.00 | Pass |
| 6 | Erroneous | ten | A helpful message | Program stops with a ValueError | Fail |
1 When I tested the program it didnt work. 2 Test 4 was wrong because their was a sintax error on line 4. 3 The program gave £8.50 to someone who was 65 and it should of been £6.00. 4 I changed the thing on line 4 to fix it. 5 I then tested it again and it works now. 6 Also when you type a word it crashs, I dont no why. 7 The progam is now finished and has no bugs.
(The small numbers show the sentence numbers. They are not part of Ifan’s writing.)
| Word | Meaning |
|---|---|
| syntax error | The code breaks the rules of the language, so it will not run at all, for example a missing colon. |
| logic error | The code runs, but gives the wrong result because the instructions are wrong. |
| runtime error | The program starts but stops while running, for example when int() is given a word. |
| condition | A test that is True or False, such as age > 65. |
| comparison operator | A symbol that compares two values: <, >, <=, >=, ==, !=. |
| boundary data | Values at the edge of a range, where mistakes are most likely. |
| validation | Checking that input is sensible before using it. |
| retest | Running the tests again after a change, including tests that passed before. |