TOPIC 07/5118 MINNOT STARTED

Data and analytics testing

Check that the figures on a report match the source data, find the first place they differ and agree what each number means.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: checking a school's report cards. Each mark on a report card should match the exam paper. The average should add up from the marks. If a child has 6 exams, the card should not list 7. A good check goes back to the papers.

Daily List is a to-do list app. Nina has a weekly chart of finished tasks. It says 7 were finished on the busy days. Tom counts the finished tasks in the database and gets 6. One task seems to have been counted twice.

Tom does not guess. He goes back one step at a time, from the chart to the report table, and from the table to the stored tasks. He finds a place where one task appears in two rows. That is the extra one.

This is data and analytics testing: checking that the numbers people read on reports match the data they came from.

The picture has a limit. A report card has a few marks. A report may use millions of rows, and the rules for it may be written in many places.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Checking that the numbers people read match the data they came from, one step at a time.

  1. Read the rule
  2. Query the source
  3. Compare each step
  4. Report the first difference
Back to the paper, step by step

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A mark on the report cardA figure on the report
The exam paperThe source data
Adding the marks againAn independent query
The teacher's marking ruleThe metric definition

WHERE THIS PICTURE STOPS

  • A report card has a few marks. A report may have millions of rows.
  • An exam paper is one piece of paper. Data passes through many steps.
  • A teacher checks by eye. A tester writes a query.

HOOK

Back to the paper, step by step.

REMEMBER IT THIS WAY

A rule of thumb: if you see this, think that.

If a number on a chart looks wrong, usually go back one step at a time toward the source until the first difference shows.

What each part of the trick stands for
In the trickWhat it stands for
Charta weekly chart of finished tasks
Sourcecount the finished tasks in the database

The business rule behind the number is itself unclear, so no step can be called wrong.

TELL A FRIEND

Checking a school's report cards by going back to the exam papers and adding the marks again.

OFTEN MIXED UP WITH How do you know the right answer? Test oracles. The oracle lesson asks how you know a result is right. This lesson uses the source data as that answer for a report.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. Market practice

    Grain (Kimball Group dimensional modeling techniques) ↗ — Kimball Group · The grain states exactly what one row of a fact table means; do not mix grains in one table (search excerpt, page not opened)

    Says the grain states exactly what one row of a fact table means and that different grains must not be mixed in one table. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Add data tests to your DAG (dbt documentation) ↗ — dbt Labs · Built-in tests unique, not_null, accepted_values and relationships; a test passes when its query returns zero rows (search excerpt, page not opened)

    Lists the built-in unique, not_null, accepted_values and relationships tests and says a test passes when its query returns zero rows. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    expect_table_row_count_to_equal (Great Expectations) ↗ — Great Expectations · A row count expectation and one that compares row counts between two tables (search excerpt, page not opened)

    Documents a row count expectation and a sibling that compares row counts between two tables. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    Extract, transform, load (ETL) testing: testing in ETL and data-centric projects (EuroSTAR Huddle) ↗ — EuroSTAR Huddle · Testing in extract, transform, load and other data-centric projects (search excerpt, page not opened)

    Per the search excerpt, a community article on checking data that is moved from one store to another: counts, sums and a row-by-row comparison. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.