2.3.1

Defensive Design Considerations

Test yourself

Defensive Design

Defensive design is an approach to software development that aims to produce robust and reliable programs.

Illustrative background for Defensive designIllustrative background for Defensive design ?? "content

Defensive design

  • Defensive design considerations include:
    • Anticipating misuse of the program.
    • Writing maintainable code.
    • Testing the program.
Illustrative background for Robust and reliableIllustrative background for Robust and reliable ?? "content

Robust and reliable

  • Robust programs can handle unexpected inputs and data without crashing and without being tricked into malicious action.
  • Reliable programs will work as intended under many different conditions or situations.
Illustrative background for Anticipating misuseIllustrative background for Anticipating misuse ?? "content

Anticipating misuse

  • There are a number of ways that a system could be misused:
    • Malicious inputs.
    • Attempts to remotely connect.
    • Attempts to alter access rights.
    • Brute force attacks.

Validation and Sanitisation

Validation and sanitisation can help to protect against malicious inputs such as SQL injection attacks.

Illustrative background for Input sanitisationIllustrative background for Input sanitisation ?? "content

Input sanitisation

  • Input sanitisation involves the removal of unwanted characters from input data.
  • This is a chief line of defence against attacks such as the SQL injection attack.
  • Any data entered by users which might be executed or become part of a query should first be sanitised.
Illustrative background for Input validationIllustrative background for Input validation ?? "content

Input validation

  • Input validation is the process of making sure that input data meets certain criteria.
  • If a user's data is rejected, they should be informed and asked to enter it again.
Illustrative background for Input validation rulesIllustrative background for Input validation rules ?? "content

Input validation rules

  • Type checks check the type (e.g. Integer) of the input.
  • Range checks check that the data is inside an allowed range, e.g. less than 100.
  • Presence checks check that the required data has been input.
  • Format checks check that the data fits a set format, e.g. an email address has an @ symbol.
  • Length checks check that the number of characters entered is inside a permitted range.

Jump to other topics

1Computer Systems

1.1Systems Architecture

1.2Memory & Storage

1.3Computer Networks, Connections & Protocols

1.4Network Security

1.5Systems Software

1.6Ethical, Legal, Cultural & Environmental Concern

2Computational Thinking, Algorithms and Programming

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson