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
| Word | What it means | Example |
|---|---|---|
| Non-functional testing | Tests of how well the software works, not what it does. | Is it fast enough? |
| Availability | How much of the time the software is working. | Up for 23 hours out of 24 |
| Compatibility | Working on different devices and with different software. | Phone and laptop |
| Configuration | The settings and set-up the software runs with. | Language, memory, time zone |
| Load | How much work the software has at one time. | 50,000 users at once |
| Response time | How long the user waits for an answer. | 2 seconds |
| Average | The total divided by how many numbers there are. | 1, 2 and 6 add up to 9. 9 divided by 3 is 3. |
| Crash | The software stops working suddenly. | A blank screen |
| Server | A 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
| Test | The question it asks | Example |
|---|---|---|
| Availability testing | Is it up and working when users need it? | Check the site every minute for a week |
| Compatibility testing | Does it work with other devices, systems and software? | Open the app on an old phone and a new one |
| Configuration testing | Does it work with each set of settings? | Try it in English, then in Japanese |
| Load testing | Does 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
| Step | What you do | Number |
|---|---|---|
| 1 | Minutes in one day: 24 hours times 60 | 1440 |
| 2 | Minutes the site was down | 14 |
| 3 | Minutes the site was up: 1440 minus 14 | 1426 |
| 4 | Write the result | Up 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
# 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.
# 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