2.3 Robust Programs

Cards (14)

  • what is validation in programming?
    Validation is checking whether input data should be allowed or is sensible and follows criteria
  • Types of validation
    1. Range Check - Checks data is sensible limits
    2. Type check - checks data is the correct data type
    3. Format check - checks data is entered in correct format
    4. Presence check - checks data is entered and not blank
    5. Length check - checks length of input is within certain amount
  • What is authentication?
    Ensuring only allowed/ authorised user can gain access
    E.g username and password, number of bank account
  • What is anticipating misuse?
    The practice of anticipating all possible way a user could misuse a device
  • maintainability of a program
    1. comments- enables a programmer to understand the purpose of a line of code used
    2. indentation - improve readability and clearly shows each block of code
    3. naming conventions- using sensible names/ variables so it’s easier to understand
    4. use of sub-program - easier to debug code, reuse code and easier to test
  • Purpose of testing:
    • to find errors and fix them
    • To ensure output is correct
    • End result meets user requirements
  • Two types of testing are?
    • iterative testing
    • Final/terminal testing
  • What is iterative testing?
    • tested during development
    • Programmer develops module tests it and repeats until module works as expected
  • What is final/terminal testing?
    • tested after development and before program is released
    • Takes place once all module are tested so programs works as expected
  • Test data
    • used to test wether a program is functioning properly
  • Types of test data:
    1. valid data- sensible data that program should accept and be able to process
    2. boundary data - data at the extreme boundary of any data ranges , ensures that system only allows data up to the max and min value
    3. erroneous data- data that program can’t process and accept
  • Two types of errors:
    • Syntax error
    • Logic error
  • What is syntax error?
    • an error in the grammar of the program or an error that breaks the rules of the programming language
    • contain an error and will not run
  • What is a logic error?
    • an error that results in incorrect output or unexpected result
    • contain error but still run and produce wrong output