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

Free lesson

Task 2 B, A: Testing by hand and the test log

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.

80 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 MOT before the car goes out

Before a car can go on the road each year, a tester checks it against a list: brakes, lights, tyres, seat belts. Each check passes or fails, and the result is written down.

A failed check is fixed, then checked again.

Your app gets the same treatment before it goes to the client.

Key words

WordWhat it meansExample
Test logA table of every test: what was done, what should happen, what did happen.
Acceptance criteriaPass or fail checks that show a story is finished.
Normal dataSensible input the app should accept.a 20 letter title
Boundary dataInput right at the edge of what is allowed.150 and 151 letters
Erroneous dataWrong input the app should refuse.tier=abc
Black box testingTesting what the app does, without looking at the code.

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

By the end of this lesson

Note

I can test an app by hand against its acceptance criteria and record the results.

Starter: what you already know

Have a go

Starter: what you already know

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

The review sprint, step 15: the goal

PartFor this step
Sprint (a short block of work)Review: check the whole app and document how it was made.
This stepTest every story by hand, record each result in the test log, fix what fails and test again.
StoriesAll of them, from E1 to E6. Each test names the one it checks.

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

Every test checks one criterion

Start from your acceptance criteria from Task 1. Each one becomes at least one test.

Test with three kinds of input. Normal data should be accepted. Boundary data sits right at the edge, such as 150 and 151 letters. Erroneous data should be refused with a clear message.

Test as each role. Test what a browser would never send, by changing a form value in the browser's tools.

Worked example: four rows of a test log

IDTest and criterionStepsExpectedActualResult
T12Empty request form (E2.1, E6.4)Send the form with every box emptyEach problem listed and linked to its boxFour messages, each a link and beside its boxPass
T19Escalate needs a reason (E2.4)Escalate NTH-0013 with no reason, then with oneRefused, then moved to Tier 2Refused with a message, then Tier 2Pass
T30Long job title (E3.1, E6.4)Send a 300 letter title from the browser's toolsRefusedSaved: only the browser stopped itFail, fixed, retested: pass
T35Another engineer's brief (E1.2, E3.3)As tier2, open Priya's job by its addressError 403Error 403Pass

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

Check: planning tests

Have a go

Check: planning tests

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

Match each input to its kind of data

Have a go

Loading…

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

A failed test is a gift

When a test fails, write down what really happened. Then debug: find the cause, by reading the code and trying again.

Fix it, put a short comment in the code naming the test, and run the same test again. Record the fix and the new result.

The companion app ran fifty tests. Six failed, and every one was fixed and retested. That is the iteration (another round of improvement) the task wants to see.

Fix for T21: no escalating a finished request

Code: python
# helpdesk/tickets.py, inside escalate(ticket_id), after test T21 failed
    # Test log T21: a resolved or closed request could be escalated, which left
    # it unassigned at a higher tier with nobody needing to act.
    if ticket.status not in ["new", "open", "waiting"]:
        flash("Only open requests can be escalated. Reopen it with an update first.")
    elif not new_tier.isdigit() or int(new_tier) not in TIERS or int(new_tier) <= ticket.tier:
        flash("Choose a higher tier to escalate to.")

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

Fix for T30: check the title length

Code: python
# helpdesk/jobs.py, inside check_job_form, after test T30 failed
    values["title"] = form.get("title", "").strip()
    if not values["title"]:
        errors["title"] = "Enter a title for the job."
    elif len(values["title"]) > 150:
        # Test log T30: only the browser's maxlength stopped long titles.
        errors["title"] = "The title must be 150 characters or fewer."

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

Check: after a failed test

Have a go

Check: after a failed test

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

A common mistake

Warning

Many students hide failed tests, so the log shows only passes. A log of all passes looks like the testing was too easy. Record every failure, the fix and the retest. Finding and fixing faults is exactly what earns credit.

Three kinds of change that testing finds

KindWhat it isExample from the companion app
ErrorWrong output or a crashEscalating a resolved request left nobody to act (T21)
RefinementWorks, but could be better madeArticle views counted on every reload, so now once per person (T41)
ImprovementBetter for users or the businessCustomers are now told when a visit is cancelled (T36)

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

Test more than the forms

Work out each KPI (a number the client watches) by hand from the sample data and compare it with the reports page.

Check accessibility (use by everyone): Tab through each page, check every box has a label, and turn on larger text and high contrast. Check other browsers and a phone. Ask a classmate to review a page of your code.

End the log honestly with what is left to test, such as a session with a screen reader.

Check: wider testing

Have a go

Check: wider testing

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 turn: your own test log

Write a test log for your app with at least twenty tests. Use the columns: ID, test, story or criterion, steps, expected, actual, pass or fail, fix. Cover every epic, every role, and normal, boundary and erroneous data. Include at least three tests a normal browser would not send, by changing a form value in the browser's tools. Check two KPIs by hand. For every failure, fix it, add a comment naming the test, retest, and record the result. End with a short list of what is still left to test.

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.

Compare with the step 15 code

Tip

Read the full test log in the step 15 code on GitHub, in docs/test-log.md. Search the code for "Test log T" to find every fix.

Change log entry for step 15

DateVersion and filesWhat changedWhy
23 Marchstep-15: test-log.md, tickets.py, jobs.py, articles.py, main.py, tickets/detail.htmlFifty manual tests recorded; six failures fixed and retestedTo show the app meets its criteria and to find what reading the code missed

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

Next: the change and source log

In step 16, the last step, you finish the change and source log. It credits everything made by others, including code from an AI coding assistant. You also write the README and record the screencast.

Exit quiz

Have a go

Exit quiz

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.