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 7.1 (2 of 4): Non-functional testing

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.

40 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

Ticket day

Tickets for a big concert go on sale at 9:00. Fifty thousand fans open the website at the same time.

At 9:01 the site stops. Every button worked when the team tested it. So what went wrong?

The team tested what the site does. They did not test how well it works when many people use it.

Key words

WordWhat it meansExample
Non-functional testingTests of how well the software works, not what it does.Is it fast enough?
AvailabilityHow much of the time the software is working.Up for 23 hours out of 24
CompatibilityWorking on different devices and with different software.Phone and laptop
ConfigurationThe settings and set-up the software runs with.Language, memory, time zone
LoadHow much work the software has at one time.50,000 users at once
Response timeHow long the user waits for an answer.2 seconds
AverageThe total divided by how many numbers there are.1, 2 and 6 add up to 9. 9 divided by 3 is 3.
CrashThe software stops working suddenly.A blank screen
ServerA computer that runs a website or app for many users.The ticket website computer

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

Four tests of how well it works

TestThe question it asksExample
Availability testingIs it up and working when users need it?Check the site every minute for a week
Compatibility testingDoes it work with other devices, systems and software?Open the app on an old phone and a new one
Configuration testingDoes it work with each set of settings?Try it in English, then in Japanese
Load testingDoes it work when many users use it at once?Send 5,000 fake users to the site

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

Match each test to its problem

Have a go

Loading…

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

Availability compares up time with all time

Users want the service when they need it. Availability is the time it is up, compared with the whole time.

A day has 1440 minutes. If a site is down for 14 minutes, it is up for 1426 minutes. That is very good. A site that is down for 2 hours is not.

Worked example: one day

StepWhat you doNumber
1Minutes in one day: 24 hours times 601440
2Minutes the site was down14
3Minutes the site was up: 1440 minus 141426
4Write the resultUp for 1426 minutes out of 1440

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

A load test adds users until it breaks

A load test sends many fake users to the software. It starts with a few users and adds more and more.

The tester watches the response time and finds the point where it gets slow, or where it crashes. Now the team knows how many users the site can handle.

Try it: response times

Code: python
# Time in seconds for five users
times = [1, 2, 2, 9, 1]

print("Slowest:", max(times))
print("Total:", sum(times))
print("Average:", sum(times) / len(times))

# Change 9 to 2, then press Run. Watch how the average changes.

Make a free account to save your work and track your progress.

More users, slower answers, then a crash

flowchart LR
  a[10 users: 1 second] --> b[100 users: 1 second]
  b --> c[1000 users: 4 seconds, slow]
  c --> d[5000 users: crash]
  d --> e[Result: fine at 100 users, slow at 1000, so the site copes with some number between them]

The average can hide a slow user

Tip

Many people judge speed by the average alone. The average hides a very slow user. In the Try it block the average is 3, but one user waited 9 seconds. So a good load test looks at the slowest time too.

Your turn: read a load test

A load test gives a list of response times in seconds. Fill in four functions. slowest gives the biggest time. slow_count counts the users who waited more than the limit. average_time adds the times and divides by how many there are. passed is True when the number of slow users is not more than allowed_slow. Press Run Tests.

Code: python
# Every number is the time, in seconds, that one user waited.

def slowest(times):
    # Give back the biggest time.
    return 0


def slow_count(times, limit):
    # Count how many times are over the limit.
    return 0


def average_time(times):
    # Add all the times, then divide by how many there are.
    return 0


def passed(times, limit, allowed_slow):
    # True if the number of slow users is not more than allowed_slow.
    return False

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

Compatibility is outside, configuration is inside

Compatibility is about other things around your software: the phone, the system, the browser.

Configuration is about the settings inside it: the language, the time zone, the amount of memory. A bug can appear with one setting and not with another. So test the settings that people really use.

Plan four tests

A college has a new app for students to see their timetable. 2000 students will use it, most of them at 8:45 on a Monday. 1. Write one test for each kind: availability, compatibility, configuration and load. 2. For each test, write what you do. 3. For each test, write what a good result looks like, with a number where you can (for example, a page opens in under 3 seconds).

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.

Key words crossword

Have a go

Loading…

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

Final check

Have a go

Final check

6 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.