Multiple choice › Testing
Testing
1. Testing
Which set of test data is MOST useful for the rule 'accept ages from 13 to 18 inclusive'?
- 12, 13, 18, 19
- 1, 2, 3, 4
- 13, 14, 15, 16
- 20, 30, 40, 50
Answer
A
Test boundaries on both sides of each limit (12/13 and 18/19), plus a typical value.
2. Testing
Which of these is a LOGIC error?
- Dividing by zero when the user enters 0
- Forgetting a colon after if in Python
- Misspelling print as pritn
- A program that calculates an average by dividing by 10 instead of the count of numbers
Answer
D
Logic errors run but give wrong results. Syntax errors stop the code compiling/running; runtime errors crash during execution (e.g. divide by zero).