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

Free lesson

OS 1.4 (2 of 2): Non-functional requirements, KPIs and acceptance

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

55 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

The phone that does everything, badly

A new phone can call, text, play music and take photos. It does everything a phone must do.

But each app takes 10 seconds to open, the battery lasts one hour, and anybody can unlock it.

Would you buy it? No. It does the job, but badly. A requirement is something the software must do or be. A non-functional requirement says how well the software must work.

Key words

WordWhat it meansExample
Functional requirementSomething the software must do.send a receipt
Non-functional requirementHow well the software must work.send it in 5 seconds
ScalabilityHow well the software copes as it grows.500 users now, 50,000 later
AccessibilityMaking software usable by people with different needs.a text description for people who cannot see the picture
KPIA number that shows if the software is doing well enough.a page loads in 2 seconds
MetricSomething you measure in numbers.milliseconds, users, minutes
MillisecondA thousandth of a second.2,000 milliseconds is 2 seconds
Acceptance criteriaChecks that must pass before the client accepts the work.The receipt arrives by email.
SpikeA short trial, with a fixed time, to learn something.2 days to test a new service

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

Kinds of non-functional requirement

KindThe questionExample with a number
SecurityWho can get in or see data?Accounts lock after 5 wrong passwords
AccessibilityWho can use it?All text can be made twice as big
ScalabilityDoes it still work when there are many more users?Works for 500 users now and 5,000 next year
ResponsivenessHow quick is it?A page answers in 2 seconds or less
Load handlingHow many at once?Works for 500 users at the same time
ReliabilityHow often is it not working?Down (not working) for no more than 45 minutes a month

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

Check: what it does or how well

Have a go

Check: what it does or how well

8 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

Check: a good requirement has a number

Have a go

Check: a good requirement has a number

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

Check three KPIs in code

A shop app has three KPIs. Responsiveness: the page answers in 2000 milliseconds or less. Load handling: it must work for 500 users at the same time. Reliability: the system may be down (not working) for no more than 45 minutes in a month. Write four small functions. The last one gives back the list of KPIs that fail. Press Run Tests when you are ready.

Code: python
def response_ok(response_ms, limit_ms):
    # Responsiveness: the page must answer in limit_ms milliseconds or less.
    # Give back True or False.
    return None


def load_ok(users_now, users_allowed):
    # Load handling: the system must cope with users_allowed users at once.
    # Give back True if users_now is not more than users_allowed.
    return None


def reliable(downtime_minutes, allowed_minutes):
    # Reliability: the system may be down for allowed_minutes in a month, no more.
    # Give back True if downtime_minutes is within that limit.
    return None


def report(response_ms, users_now, downtime_minutes):
    # Targets: 2000 milliseconds, 500 users, 45 minutes.
    # Give back a list of the names of the KPIs that FAIL, in this order:
    # "responsiveness", "load", "reliability". An empty list means all pass.
    return None

Make a free account to save your work, or press Start lab to work through the whole lesson.

Acceptance criteria

Acceptance criteria are checks. When all of them pass, the client says: "Yes, this is done."

A simple way to write one is: Given a starting point, When the user does something, Then this should happen.

Acceptance criteria for a password reset

GivenWhenThen
I forgot my passwordI press Reset and type my emailAn email arrives within 1 minute
The email arrivesI click the linkI can choose a new password
I typed an email that has no accountI press ResetI see the same message, so nobody learns which emails exist
The link is more than 1 hour oldI click itI am told it has expired

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

Write acceptance criteria for a booking

A cinema app lets customers book a seat.

Write three non-functional requirements with numbers (one about responsiveness, one about load handling, and one about accessibility or security).

Then write four acceptance criteria for "book a seat". Use this template for each:

Given ... When ... Then ...

Example: Given a seat is already taken, When I try to book it, Then I see a message and I cannot book it.

A teacher marks this in a college. Nothing you write here is kept: it goes when you leave the page.

Make a free account to save your work, or press Start lab to work through the whole lesson.

Spike: a short trial to learn

Sometimes you do not know enough to write a requirement. Can a new payment service work with our app? How big is the problem?

A spike is a short trial, with a fixed time. You learn, then you decide.

How a spike works

flowchart TD
  a[We are unsure about something] --> b[Set a question and a time limit, for example 2 days]
  b --> c[Try a small test or do some research]
  c --> d{Did we learn enough?}
  d -->|yes| e[Write clear requirements and the scope]
  d -->|no| f[Say what is still unknown]
  f --> g[Plan another spike or ask the client]

Two meanings of spike

Warning

Many people think a spike is always a load test. In this course, a spike is a short trial before the real build. Some books use "spike testing" for a sudden jump in users. If a question is about finding out what to build, it means the short trial.

Final check

Have a go

Final check

5 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

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.