Creating Robust Programs Flashcards
What is anticipation and protection done through?
Validation Sanitation Authentication Maintenance Testing
What is a defensive design?
A program that runs correctly and continues to run no matter the user input.
How may programers apply defensive design?
Anticipating how users may misuse their program then attempt to prevent it
Ensure their code is well maintained
Minimising the number of errors through testing
What is the best way to prevent a user from accidentally or intentionally misusing a program when entering data?
Through input validation
What is validation?
Checking if data meets certain criteria before passing into the program
Name the different types of validation.
Range check Presence check Format check Look up table Length check
Describe what a range check does?
Checks the data is within a specified range
Describe what a presence check does?
Checks the data has actually been entered
Describe what look up table does
Checks the data against a table of acceptable values
Describe what a length check does
Checks the data is the correct length
Karen wants to validate usernames for an online forum. She wants each username to be longer than five characters and start with an upper case letter.
Give two validation checks Karen would need to use.
Length check - to make sure the username is not longer or shorter than the length allowed
Format check - To make sure the username starts with an uppercase letter
Name a reason for authentication
Authentication helps protect your programs
It can confirm the identity of a user before they’re are allowed to access certain pieces of data or features of a program
What are common ways to increase the security of a password based authentication system?
Force users to use strong passwords and have them change passwords regularly
Limit the number of failed authentication attempts before access to an account is lost
Ask for a random selection of characters from the password on each authentication
Why is it important to get the level of authentication correct?
Too much authentication can affect a programs functionality and put people off using it
Name two different types of errors
Syntax errors
Logic errors