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

Preview

Unit 7 C3: Test plans and testing a peer's app

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

55 minutes

The score page that refused a full mark

A student builds a quiz score page for the made-up Eastfield Maths Club. The score must be a whole number from 0 to 10. The student types 5 and it works, so the page is done.

On the day, the first pupil to get full marks types 10. The page says it is not allowed. One test would have found it. A plan makes sure the right tests are run.

By the end of this lesson

Note

I can plan tests for an app, run them and give a peer useful feedback.

Key words

WordWhat it means
Test plana table of the tests to run and what should happen
Expected resultwhat should happen if the app is right
Actual resultwhat really happened when you ran the test
Normal dataa sensible value that should work
Boundary dataa value right at the edge of what is allowed
Erroneous dataa wrong value that should be refused

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

Starter: what you already know

Have a go

Starter: what you already know

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

A test plan lists each test

A test plan is a table. For each test it gives the test itself, its purpose, the expected result and the actual result. If they differ, there is a fault. A last column records the error and the action you will take.

Write the expected result before you run the test. If you write it after, you may be tempted to copy what you saw.

Test with three kinds of data

For every input, test three kinds of value. Normal data is a sensible value, such as 5. Boundary data is at the edge, such as 0 and 10, which are the lowest and highest allowed. Erroneous data is wrong and must be refused, such as 11, -1, 3.5, or a blank box.

Faults often hide at the edges.

Try it: test the score page

Code: web
<h2>Quiz score</h2>
<label for="score">Score (0 to 10)</label>
<input id="score" type="number">
<button id="save">Save</button>
<p id="out" role="status"></p>
<!-- Test 5, 0, 10, 11, -1 and a blank box. Write down each result. -->

A test plan for the score page

TestPurposeExpectedActualError and action
Type 5Normal data is savedSaved: 5Saved: 5None
Type 0Lowest boundarySaved: 0Saved: 0None
Type 10Highest boundarySaved: 10Please type a whole numberFault: the check refuses 10. Change >= to >
Type 11Erroneous data is refusedPlease type a whole numberPlease type a whole numberNone
Leave blankEmpty box is refusedPlease type a whole numberPlease type a whole numberNone

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

Check

Have a go

Check

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.

The lesson goes on

7 more parts of this lesson are in the full lesson, which colleges teach from the Library. A college account gives your students all of it.