Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Summary

Summary GCSE OCR Computer Science Revision Notes for Defensive Design

Document preview thumbnail
Preview 2 out of 5 pages

These in-depth and comprehensive GCSE OCR Computer Science notes helped me to achieve a high Grade 9 in my GCSE Examinations. They were created using a wide array (pun intended) of online resources, including but not limited to Physics and Maths Tutor, Craig n Dave, ISAAC Computer Science, ZigZag Learner Companion and Teach-ICT.

Content preview

Defensive design

Anticipating misuse

Defensive design is the practice of anticipating every possible way that an end-user could misuse a
system or device so that the number of errors/bugs is minimised. This means that the program will
behave as expected in spite of unexpected user actions. All possible errors are identified and allowed
for by writing the appropriate code to deal with them properly.

If the program crashes, behaves in an unintended fashion or the data security has been
compromised, then the defensive design has not been adequate.

For example, division by zero may crash a program.

Communication error – as online systems require connections to host servers, when this connection
is dropped, the program could potentially crash or hang when loading/saving data, so the
programmer should enable the user to cancel requests or to report connection errors so that the
program can resume when connection is available again

Disk errors – read to and write to programs need to handle many types of exceptions such as

 file/folder not being found
 disk being out of space
 data in the file being corrupt
 end of file being reached

robust programs will check files and data before attempting to use them for further processing

Printer/peripheral errors – if printer runs out of paper, ink or have a jam, the user must have the
option to reprint and not assume all are successful

Authentication

Authentication is a way of confirming that the user is authorised to access the system

The entered details of a username and password are checked against a database containing valid
accounts

Two – factor authentication – sending an SMS text to the designated mobile phone

Biometric – fingerprint, face id, optical sent off to a database and checked against their valid data

Including encryption within the application helps with data security, password set is encrypted
before being stored in a database/file

Authentication is not foolproof – could be identity theft

authentication – if you want to recover a password click on a link within an email sent to the
registered address

online bots can submit data automatically to online forms and this is protected by reCAPTCHA which
verifies that the user is human

SQL injection hacks and other hacking methods should also be aware to programmers

, User Interface

To choose the right interface you must consider balancing the access given to users on all the
information and abilities they might need, as well as imposing limits on the things they commonly
get wrong.

Menu Driven Interface limits the user to being able to pick from a displayed list of choices. This helps
to limit unexpected or invalid entries. However, this is not very flexible.

Screen widgets

The calendar widget – pops up a calendar from which the user can select a date so the programmer
is able to pick from a variety of choices and they cannot select an invalid or erroneous date

Colour picker widget – this does contain a number of input boxes so it is possible for the user to get
things wrong

Drop down lists – number of items the user is allowed to select, the numeric data entry will always
be valid

Text entry

Most flexible way of accepting inputs from the user – but also the most problematic

The programmer should inform the user with clear unambiguous instructions on screen of what they
need to enter

Also the option to re-enter passwords to ensure that the initial password is what the user intended
to write

The input box

It is the most vulnerable to problems. Defensive measures used in input boxes are known as
validation.

Input validation

Validation seeks to ensure that data entered is valid for further processing by the program handling
it by checking it against specific criteria. This ensures that the program will not crash if the user
enters an unreasonable or incorrect value

Validation only checks if data item is reasonable, not show if it is correct

Verification double checks that the data has been typed in correctly- data is entered twice and
compared in verification

Four validation methods:

 Checking and limiting length of data
 Checking the range of data
 Checking the type of data
 Checking the format of data

Length

Rejecting entries that are too long or too short

Document information

Study
School year
3
Uploaded on
September 2, 2026
Number of pages
5
Written in
2024/2025
Type
Summary
£11.66

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
29
Last sold
-




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions