Defensive Design Flashcards
What is defensive design?
To ensure programs function properly + don’t produce errors
How do programmers carry out defensive design?
Anticipate how users may misuse program
Ensure code is well - maintained
Testing to reduce errors
Input Validation
Checking if data meets certain criteria before passing it into the program
Example of input validation
Checking that an email contains @ symbol
Types of Input validation check
Range Check
Presence Check
Format Check
Look-up table
Length table
Input Validation: Range Check
Checks if data is within a specified range
Input Validation: Presence Check
Checks if data has been enterd
Input Validation: Format Check
Checks if data is in correct format
Input Validation: Look-up Table
Ches the data against a table of acceptable values
Input Validation: Length Table
Checks if data is the correct length
Authentication
To confirm the identity of a user before they are given access to data
Example of Authentication
Passwords - can be associated with their username
Ways to increase the security of a password - based authentication system:
Force users to use strong passwords
Limit the number of failed attempts before access is blocked