2.3 New Flashcards
Defensive design
Approach to software development where every possible input from a user is considered
Purpose of defensive design
-to anticipate ways a user could misuse a program
-ensure the final program is robust and reliable for all users
What can developers do to anticipate errors in programs
Ensure the software has a way of dealing with the potential errors to ensure software does not crash
Examples of error in programs
-peripheral errors
-disk errors
-communication errors
Peripheral error
-When peripherals do not perform as intended
-eg printer runs out of paper(fix is allow user to reprinting document after refilling the paper)
Disk error
-Error that occur on a disk
-such as disk running out of space(fix=allowing user to save work on another disk)
Communication errors
Applications using online systems losing online connection to the host server(fix = automatically retry if connection resumes)
Authentication
Process of ensuring that a system is secure by asking the user to complete tasks to prove they are an authorised user of the system
Examples of authentication
-Usernames and passwords
-CAPTCHA
Input validation
Code which is used to check that an input from a user is acceptable and matches the requirements of the program
What are the 5 main categories of validation
Length check
Type check
Range check
Presence check
Format check
Type check
Checking if what is entered is a certain data type such as integers for age
Range check
Ensuring data entered falls under a particular range such as between 0-100 for age
Length check
Checks the length of a string and checks if it meets the condition
Presence check
Looks to check if any data has been entered in a field