The purpose of defensive design is to ensure that a programSequences of instructions for a computer. 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:
protection against unexpected user inputData which is inserted into a system for processing and/or storage. or actions, such as a user entering a letter where a number was expected
maintainability - ensuring code is readable and understandable
minimising/removing bugAn error in a program.
This anticipation and protection is done through:
validationChecking input data is sensible and in the right format.
data sanitisation The process of hiding or protecting data so it cannot be seen or disclosed.
authenticationVerifying the identity of a user.
maintainability The process of ensuring that a program is easy to understand, modify and update.
testingAn important part of computer programming which involves checking a program for errors.