Data Quality Quick Reference

A compact lookup for the six quality dimensions, data contracts, expectation-based checks, the four-layer testing pyramid, statistical anomaly detection, and hard vs. soft failure severity.

The six dimensions#

Text
Accuracy      does the value reflect reality?Completeness  is anything missing?Consistency   do related values agree with each other?Timeliness    is the data recent enough to be useful?Uniqueness    does the same entity appear more than once?Validity      does a value conform to its defined format/range?

Data contract checklist#

Text
Schema:       field names, types, nullabilitySemantics:    what each field actually means (units, encoding)Guarantees:   freshness, completeness, ordering SLAsChange policy: how a breaking change gets communicated before it landsOwner:        a named team on the producer side

Expectation-based check#

Python
validator.expect_column_values_to_not_be_null("customer_id")validator.expect_column_values_to_be_between("amount", min_value=0)validator.expect_column_values_to_be_in_set("status", ["pending", "shipped"])

The four-layer testing pyramid#

Text
Unit           many, fast     — pure transformation logicIntegration    fewer, slower  — real/realistic systems, one stageEnd-to-end     few, slow      — full pipeline, small realistic datasetData quality   continuous     — real production data, ongoing (not pre-deploy)

Statistical anomaly check#

Python
recent = metric_history.tail(30)mean, std = recent.mean(), recent.std()is_anomalous = not (mean - 3*std <= today_value <= mean + 3*std)

Needs enough history (weeks, not days) before the bounds mean anything.

Severity#

TierResponseExample
Hard failureStop the pipelineRow count of zero, duplicate primary keys
Soft failureLog and alert, continueElevated but still-low null rate, a statistical anomaly

Checklist before trusting a check#

Text
- Does it fire when fed deliberately bad data? (test the check itself)- Is it placed at the stage where a failure would actually help  localize the problem, not only at the pipeline's final output?- Is its threshold based on enough real history to be meaningful?

Further reading#

See also#