2.3.1 Defensive Design

Cards (15)

  • What is the purpose of input sanitisation in defensive design?
    To clean up input data and remove unwanted data
  • How does verification help in defensive design?
    It checks whether data has been entered correctly by example
  • What is authentication in the context of defensive design?
    Ensuring only authorized users can gain access to the system
  • Which of the following is NOT a method of authentication?
    Visual check
  • Why is maintainable code important in defensive design?
    It allows other programmers to understand the code
  • What is validation in defensive design?
    Checking whether input data is sensible and follows criteria
  • What is a check digit used for?
    To verify that a tracking code has been entered correctly
  • What does a type check ensure?
    That the data inputted is of the correct data type
  • What is a format check?
    A check to ensure data follows a set pattern
  • What does a length check do?
    Limits the number of characters in input data
  • What is the purpose of a lookup table in validation?
    To ensure the data inputted is from an allowed set of values
  • What does a presence check verify?
    That data has been entered into a field
  • What is a range check used for?
    To ensure input is within sensible limits
  • What are the key components of maintainability in code?
    • Comments/annotations to explain functions
    • Indentation to show structure
    • Sensible variable naming for clarity
    • Modularization for reuse and testing
    • Using constants to prevent data changes
  • What is the purpose of using constants in code?
    To ensure specific data isn't changed