Defensive Design Considerations Flashcards

All 5 cards in this deck

What is defensive design?

Designing a program so it anticipates misuse and errors and keeps working (is robust) whatever the user enters.

What is input sanitisation?

Removing invalid or special characters from data entered by the user, e.g. removing quotation marks or semicolons.

What is authentication in a program?

Checking that users are allowed to access the system / confirming the identity of the user, e.g. a username and password.

True or false? A program is well designed defensively if it crashes as soon as a user types a letter into a number box.

False. Defensive design means the program handles the unexpected input, e.g. rejects it and asks again, instead of crashing.

What are the steps to add simple username and password authentication?
e.g. logging in to a school booking system

  1. Ask the user to input a username and a password.
  2. Compare what is entered with the details stored for that user.
  3. If both match, allow access; if not, display an error and ask again.