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

Preview

AESP task 2: Keep a test log for a dataset

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

60 minutes

"The data looks fine to me"

A treasurer scrolls through a list of 14 deposits and says it looks fine. It is not fine. Two rows are the same. One amount is the word "twenty".

Your eyes miss things. A test does not. And a written test can be shown to somebody else.

Key words

WordWhat it means
Testa check that finds out if something is right
Test datathe values you feed into a test
Expected resultwhat should happen, written before the test
Actual resultwhat really happened
Defecta fault in the data or the model
Annotationa short note that explains a piece of evidence
Modelthe set of tables or calculations that turns data into answers

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

By the end of this lesson

Note

I can record a data test as annotated evidence, from the test to the fix.

Starter

Have a go

Starter

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.

This is practice

Important

The real task comes from the exam board. This lesson uses an invented organisation and its own made-up data. Your teacher tells you how the real tasks are set and what you may bring.

The columns of a test log

ColumnWhat you writeExample
TestWhat you checkAre any deposit rows repeated?
PurposeWhy you check itA repeat makes a total too big
Test dataWhat you feed inAll 14 rows
ExpectedWhat should happen0 repeated groups
ActualWhat really happened1 repeated group
ComparisonDo they match?No
IssueWhat the defect isRow 4 repeats row 2
FixWhat to do about itRemove row 4 and re-test

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

Run test 1 and test 2

Code: sql
SELECT COUNT(*) AS rows_found FROM deposit;

SELECT member_ref, deposit_date, amount, branch, COUNT(*) AS times
FROM deposit
GROUP BY member_ref, deposit_date, amount, branch
HAVING COUNT(*) > 1;

Worked example: a log from those runs

TestTest dataExpectedActualMatchIssue and fix
T1 Row countAll rows1414YesNone
T2 Repeated rowsAll rows0 groups1 group: M002 on 5 Jan, 40, NorthNoRow 4 repeats row 2. Remove row 4
T3 Missing amountAmount column0 empty1 empty: row 5NoNo amount. Ask the branch, or leave out of totals
T4 Amount is a numberAmount columnAll numbersRow 6 holds the word twentyNoTyping slip. Correct to 20 if the slip is checked

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

Annotate, do not only paste

An annotation says what the result means. For T2 you might write: "The same member, date, amount and branch appear twice. The ids differ, so it is probably typed in twice."

One sentence turns a result into evidence. It also shows you understand the model.

The lesson goes on

6 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.