Revise - 2.3 - Robust programs

Everything you know about defensive design. (Methods)
1 / 18
next
Slide 1: Mind map
ComputingUpper Secondary (Key Stage 4)GCSE

This lesson contains 18 slides, with interactive quizzes and text slides.

Items in this lesson

Everything you know about defensive design. (Methods)

Slide 1 - Mind map

Defensive design 
Aspire: To identify key methods of defensive design.

Conquer :Solve exam level questions. 


Slide 2 - Slide

Why? 
We need to consider how end users will make use of the product.

We need to anticipate any way they may misuse the software, either willingly on unwillingly. 

Slide 3 - Slide

Methods
  • Anticipate Misuse
  • Maintain code
  • Verification
  • Validation
  • Reduce errors through testing

Slide 4 - Slide

Anticipate misuse. 
Planning ahead and taking steps to prevent potential misuse.

This takes place during the design and testing process before product release. 

Slide 5 - Slide

Input validation

This is the process of checking data entered by the end user to ensure it meets specific criteria. 

Example: Dates, phone numbers. 

Slide 6 - Slide

Data Validation methods. 
Range check
Format check
Presence check
Length check
Type check
The input must fall within a specified range
The data must be in the correct order.
 The data must be of a specified data type
Checks if data has been entered.   
The input must not be too long or too short.

Slide 7 - Drag question

Length Check
Has a minimum amount of characters
Range Check
Falls between two set values
Presence Check
Must be filled in - cannot be blank
Format(type) check
Must be in correct format or datatype

Slide 8 - Slide

What is authentication?
How is it different to Validation?

Slide 9 - Open question

Authentication
Authentication is the process of a user confirming that they are who they say they are on a computer system.

Methods: 
  • Passwords
  • 2FA
  • Biometrics, cards, Pin, Secret question.

Slide 10 - Slide

Maintainability
The purpose of maintainability is to ensure that, over time, a program can be easily maintained.

This could mean fixing errors, making changes or additions. 

Slide 11 - Slide

Describe TWO ways to more easily maintain your coded solutions [4]

Slide 12 - Open question

Easy to Maintain
  • Add comments - to explain key features and understanding to code
  • Indentation - to separate different statements.  Makes code easier to read
  • Sensible naming - of variables/procedures to they are recognisable easily
  • Use functions/procedures - to break up reusable code to avoid duplications

Slide 13 - Slide

Describe the purpose of testing code [2]

Slide 14 - Open question

Identify the two types of error you will encounter when programming [2]

Slide 15 - Open question

LOGICAL
SYNTAX
a = 5
b = 2
C = a+b
print(c)
primt("hello world")
if a>b
  print("bigger")
else
 print("smaller")
name = "Bob"
print("name")
if a>18:
  print("adult")
else:
 print("child")
while a !=0:
  print(a)

Slide 16 - Drag question

Test types
  • Valid - Test that falls in the expected range of a request. 
  • Invalid  - Data of the correct data type, but does not meet the rules. 
  • Erroneous  - Entering the wrong data type.
  • Boundry - Data at the min and max of a range.


Slide 17 - Slide

A system is made to store student test scores that are out of 0 to 100.
Identify suitable test data to run a valid, invalid, boundary and erroneous tests. Separate your answers with commas [4]

Slide 18 - Open question