Question 1
2 marksExplain what is meant by anticipating misuse when designing a program.
Model answer
Anticipating misuse means the programmer thinks in advance about the ways a user could use the program wrongly, such as typing letters instead of a number, leaving an input blank or trying to break in. The programmer then writes code to deal with each of these, so the program keeps working correctly instead of crashing.
Explanation
Users do not always do what the programmer expects: some make mistakes and some deliberately try to break or misuse a program. A defensively designed program caters for all likely input values, for example by validating inputs and limiting login attempts. Both parts are needed: predicting the misuse, and then handling it.
Mark scheme
-
1 mark
thinking ahead about / predicting the ways a user might use the program wrongly or enter unexpected data (by accident or on purpose)
Accept a correct example, e.g. 'predicting that a user might type letters when a number is expected'.
-
1 mark
and planning / writing code to deal with them, so the program does not crash or give incorrect results
Accept 'so that the program caters for all likely input values'.