Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Functional requirements and secure by design

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

Buy the lock after the robbery?

A shop is robbed. The owner then buys a lock. That is too late.

A wise owner plans the lock when the door is made.

Software works the same way. Safety is planned from the start. In this lesson you learn to say exactly what the software must do, and to plan safety in from the start.

Key words

WordWhat it meansExample
Functional requirementSomething the software must DO.The user can pay by card.
Non-functional requirementHow well the software must work, not what it does.It loads in 3 seconds.
Secure by designPlanning safety into the software from the very start.check every input from the start
InputData that goes into the software.a name typed in a box
ProcessingWhat the software does with the data.add up the prices
LogicThe rules and decisions in the software.if the total is 50 or more, delivery is free
PlatformThe device or system the software runs on.Android phone, web browser
RequirementSomething the software must do or be.pay by card

The cells students fill in are left blank in this preview.

Quick check: do or be?

Have a go

Quick check: do or be?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Five parts of a functional requirement

PartThe questionCinema ticket app
InputsWhat goes in?Number of adults and children, a date, an email address
Data neededWhat facts must be stored or looked up?Ticket prices, film times, booking numbers
ProcessingWhat is done with the data?Add up the cost, check there are enough free seats
LogicWhat rules and decisions apply?Groups of 10 or more get a discount
PlatformsWhere is it used and run?On phones and in a web browser; runs on a cloud server

The cells students fill in are left blank in this preview.

Try it: requirements in code

Code: python
adults = 2
children = 3

# Input: adults and children
# Data needed: the two prices
adult_price = 8
child_price = 5

# Processing: add up the cost
total = adults * adult_price + children * child_price

# Logic: a group of 10 or more gets 10 pounds off
if adults + children >= 10:
    total = total - 10

print(total)

# Change adults to 6 and children to 6, then run it again.

Secure by design

Secure by design means you ask "what could go wrong?" while you write the requirements. You do not wait for a hacker.

It changes the requirements you write. You decide who may see what. You decide that every input is checked. You decide to store only the data you really need.

Security thinking turns into requirements

Question while planningRequirement that follows
What if somebody types something harmful?Every input is checked before it is used.
Who should see a customer's details?Only the customer and named staff can see them.
What if the password is guessed?After 5 wrong tries, the account is locked for 10 minutes.
Do we need the date of birth?No. Do not collect data we do not need.
What if the data is stolen?Passwords and card details are never stored as plain text (text that anybody can read).

The cells students fill in are left blank in this preview.

The lesson goes on

4 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.