# Data Quality Testing and Observability

> Catching bad data before stakeholders do with automated tests, freshness checks, reconciliation and ownership. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/data-analyst/data-quality-testing
Last updated: 2026-11-28

Catching bad data before stakeholders do with automated tests, freshness checks, reconciliation and ownership.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Transforming Data with dbt](https://www.internhack.in/roadmaps/tracks/data-analyst/dbt), [Data Cleaning and Quality Checks](https://www.internhack.in/roadmaps/tracks/data-analyst/data-cleaning)

Every analyst has shipped a wrong number caused by bad upstream data. Automated data quality checks catch most of these before they reach a dashboard.

### Dimensions of quality

- **Completeness**: are required fields filled, did all expected rows arrive?
- **Uniqueness**: no duplicate primary keys.
- **Validity**: values in allowed ranges and sets (status in a known list, amount not negative).
- **Consistency**: foreign keys match, totals agree across tables.
- **Freshness**: data updated as recently as expected.

### Where to test

- **At ingestion**: row counts and schema changes vs the source.
- **In transformations**: dbt tests (`unique`, `not_null`, `relationships`, `accepted_values`) or libraries like Great Expectations and Soda.
- **At the output**: reconcile key metrics against a system of record (finance revenue, billing counts).

### Observability

Beyond fixed tests, monitor **volume, freshness and distribution** over time and alert on anomalies, such as a daily row count dropping 40% or a column suddenly 30% null.

### Response process

- Every critical table has an **owner**.
- Failed tests alert the owner, not a generic channel no one reads.
- Dashboards show a warning or data-as-of date when upstream checks fail.
- Write a short incident note after serious data issues: cause, impact, fix, prevention.

**Pitfall:** adding hundreds of tests nobody monitors, so failures become background noise. Start with keys, freshness and a few business rules on the most important tables. You are ready to move on when your pipeline fails loudly on duplicate keys and stale data.

## Key concepts

- **Quality dimensions**
- **Uniqueness and not-null tests**
- **Freshness checks**
- **Reconciliation against source systems**
- **Great Expectations and Soda**
- **Anomaly monitoring**
- **Ownership and incident notes**

## Mini project

Add at least eight tests to a dbt project (keys, accepted values, relationships, freshness) and one custom test that total order revenue matches payments within 0.5%.

## Check yourself

Which three data quality checks would you add first to an orders table feeding the revenue dashboard?

## Free resources

- [dbt docs: data tests](https://docs.getdbt.com/docs/build/data-tests) (dbt Labs)
- [Great Expectations documentation](https://docs.greatexpectations.io/) (Great Expectations)

Previous: [Scheduling and Orchestration with Airflow](https://www.internhack.in/roadmaps/tracks/data-analyst/orchestration) · Next: [Time Series Forecasting](https://www.internhack.in/roadmaps/tracks/data-analyst/forecasting)

## More in Analytics Engineering

- [ETL, ELT and the Modern Data Stack](https://www.internhack.in/roadmaps/tracks/data-analyst/elt-pipelines)
- [Transforming Data with dbt](https://www.internhack.in/roadmaps/tracks/data-analyst/dbt)
- [Scheduling and Orchestration with Airflow](https://www.internhack.in/roadmaps/tracks/data-analyst/orchestration)
- [Data Quality Testing and Observability](https://www.internhack.in/roadmaps/tracks/data-analyst/data-quality-testing)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Analyst Roadmap](https://www.internhack.in/roadmaps/tracks/data-analyst)
