Programs must run correctly or they are of little value. Careful planning and testing of a program are essential, as is writing maintainable code.
The purpose of defensive design is to ensure that a program runs correctly and continues to run no matter what actions a user takes. This is done through planning for all possibilities (contingencies) and thinking about what a user may do that the program does not expect.
Defensive design encompasses three areas:
This anticipation and protection is done through: