What is data testing?

Data testing is running automated checks that assert what data should look like, such as no null keys or row counts in range, and fail when it doesn't. In production, code is fixed and data changes, so tests catch bad data before customers see it. In development, data is fixed and code changes, so regression tests catch breaking changes.

Key points

  • A data test is code that checks data. It asserts something that should be true, such as no nulls in a key column or a row count inside last month's range, and fails when it isn't. Because it's code, it runs on its own, on every pipeline run or every change.
  • Data testing in production holds the code fixed while new data arrives every run, so the tests target the data: freshness, row counts, nulls, and balances between layers. Tripwires between steps stop the pipeline before bad data reaches a customer.
  • Data testing in development holds the data fixed while the code changes, so regression and impact tests run the changed pipeline on test data pulled from production and fail the build when a change moves a number it shouldn't.
  • DataKitchen's Guide to DataOps Tests names four places to test data: source data quality, observability at ingestion, tripwires in production, and regression tests on deployment. The first three test data in production; the fourth tests code in development.
  • Based on industry observations and its own research, DataKitchen estimated in September 2025 that about 80% of data teams rely primarily on hope-based testing in development, with no automated validation before changes reach production.
  • DataKitchen's Guide to DataOps Tests asks for two to three tests per table and puts a mid-size Medallion architecture at roughly 5,000 tests, so teams generate the routine tests from a data profile and write the business rules by hand.

Two kinds of data testing. In production, the code is fixed and the data is new every run, and tests on the data catch bad data, with tripwires that stop the pipeline before customers see it. In development, the code is your change and the data is known test data, and tests on the code catch breaking changes, with regression tests in CI/CD that fail the build before the deploy. Figure 1: Production runs yesterday’s code against today’s data. Development runs today’s code against yesterday’s data. Each needs its own tests.

A data test is code that checks data. It asserts something that should be true (no nulls in customer_id, a row count inside last month’s range, a revenue total that matches the source) and fails when it isn’t. That’s the definition DataKitchen uses in its Guide to DataOps Tests, and it’s the easy part.

The harder part is that data testing does two different jobs, and most teams only do one of them.

Which job a test is doing depends on what’s holding still.

Data testing in production: the code holds still

In production the code is fixed. It changes only through a release. The data is new every run, from sources you don’t control, and that’s where the surprises come from: a feed arrives short, a vendor changes a date format, a column that was full yesterday is mostly null today.

So production tests target the data. They run every time the pipeline runs. Input tests check what arrives at each step. Output tests check that a step did its job. Business logic tests check the data against what you know about the business, such as every European customer being assigned to someone on the Europe sales team. DataKitchen’s Build Trust Through Test Automation and Monitoring names three basic types on top of those: a location balance test (1 million rows at the source should still be 1 million rows in the database and in the report), a historical balance test (today’s numbers compared with history), and statistical process control, which measures the pipeline run after run and flags a number outside its normal range.

An alert after the fact isn’t enough. A tripwire is a test task between two processing steps that exits with an error when it fails. The orchestrator treats that as a failed task, so the next step never runs, and the gold table keeps serving the last good data while somebody looks. That’s the difference between learning about bad data from a customer and never shipping it.

Regression testing for data pipelines: the data holds still

In development it flips. You hold the data fixed and change the code, and the question becomes: did my change break something that worked yesterday?

That’s regression testing. In a Medallion architecture, data lands raw in bronze, gets cleaned in silver, and is shaped for the business in gold. Rename a column in silver to fix a misspelling, and a process in gold that reads it breaks, along with every report that reads gold. A unit test doesn’t see it. A manual review doesn’t either. So you run the same bronze, silver, and gold pipeline in development or QA, on test data pulled from production, and compare the outputs with the current version’s. If a row count, a null rate, or a key metric moves when it shouldn’t have, the build fails and the change doesn’t deploy. Comparing before and after is the impact test, and the result belongs on the pull request. Moving these tests into the deployment path is what DataKitchen calls shift-down data quality testing.

The alternative is slower than anyone admits. DataKitchen’s Disband Your Impact Review Board opens on companies that take six months to write 20 lines of SQL and move it into production, because the only way to judge a change is to get the senior experts in one room. A regression suite is that meeting, written down and run on every commit. The CI wiring is in How do you run data tests in CI/CD before an analytics release?, and what to compare is in How do you test data before a BI or analytics release?

Production testing vs development testing

DataKitchen’s white paper DataOps Is Not Just DevOps for Data calls these two settings the Value Pipeline and the Innovation Pipeline.

Data testing in productionData testing in development
What’s fixedThe code, which changes only through a releaseThe data: test data pulled from production, such as a filtered slice or a zero-copy clone
What changesThe data, new every runThe code: your change, a new model, a dependency upgrade
What a failure meansThe data is wrong: a bad source, a failed load, a tool that brokeYour change broke something that worked, or moved a number it shouldn’t
When it runsEvery pipeline run, between processing steps and on a scheduleOn every change, in CI/CD before the merge or deploy
Example testsFreshness, row count ranges, nulls in keys, location and historical balance, schema driftThe full pipeline run in QA, with row counts, null rates, and key metrics compared before and after
What happens on failureA hard fail stops the pipeline; a soft fail warns the rule’s ownerThe build fails and the change doesn’t deploy
What it protectsThe data you already haveThe data your next deployment will produce
Related termsData monitoring, data observability, tripwires, shift-left testingRegression testing, impact testing, shift-down testing

One test, two jobs

The same check can do either job. Take a null check on a column. Run it in production and a null in your gold fact table is a reason to stop the line. Run it in development and a column that goes null after your change means you broke something. DataKitchen’s post on four critical data team processes makes the point: one test becomes a quality metric, an alert, a tripwire, or a regression test, depending on what happens when it fails.

The Guide to DataOps Tests splits production into three places (source data quality, observability at ingestion, and tripwires between transforms) and adds deployment as the fourth. The four points in your Medallion architecture walks through each with diagrams. Skip one and you’re blind to the failure it catches. For testing where data enters, read What is shift-left data quality testing?

Most teams test at the end, and only in production

Most data testing happens in one spot: a check against the final table right before the report refreshes. That’s the most expensive place to find a problem and the worst place to learn which step caused it. Development gets even less. Based on industry observations and its own research, DataKitchen estimated in September 2025, in Flip the Script on Data Quality, that about 80% of data teams rely primarily on hope-based testing in development, with no automated validation before changes reach production.

Part of that is habit. A team ships the pipeline, the DAG turns green, and nobody watches what the data does afterward, which DataKitchen calls the ostrich problem. The bigger part is volume.

Where the tests come from

The floor in DataKitchen’s test coverage guide is two tests per table. The Guide to DataOps Tests asks for two to three, covering freshness, volume, and schema, plus at least two per column, one custom test per business metric, an error check on every tool, and a status and timing check on every job. It puts a mid-size Medallion architecture at roughly 5,000 tests. Nobody hand-writes 5,000 tests and keeps them current.

So generate the routine tests from a profile of the data, and write the business rules yourself. You need both kinds. In DataKitchen’s NYC taxi test, 62 generated tests passed on a 300,000-ride sample with fares as low as negative $367, because tests learned from the data treat what the data already looks like as normal. Seven business rules written from the profile all failed.

DataKitchen’s open-source DataOps TestGen does the generating. It profiles 60 characteristics per column, generates tests from 36 test types, and runs them as SQL inside your database, so the same suites serve as production checks between pipeline steps and as regression gates called from CI/CD through its REST API. Every check it can run is laid out in the Periodic Table of Data Quality, which you can filter by what a check catches and how much setup it needs. The core profiling, testing, and monitoring engine is free and open source. Enterprise adds team access, security, Commercial Pharma tests, source-data controls for AI, and support. For how it compares with tests you write by hand, read How is TestGen different from dbt tests or Great Expectations?

DataKitchen sells TestGen, so weigh that.

Frequently asked questions

Short answers to the follow-up questions people ask next.

What is the difference between data testing in production and in development?

The difference is which thing holds still. In production, the code is fixed and new data arrives every run, so data tests check the data and stop the pipeline when it's wrong. In development, the data is fixed and the code changes, so regression tests run the changed pipeline on known test data and fail the build when the change breaks something that worked. A team needs both.

What are the main types of data tests?

In production, input tests check what arrives at each step, output tests check that a step did its job, and business logic tests check the data against what you know about the business. DataKitchen's 2018 post Build Trust Through Test Automation and Monitoring names three basic types: location balance, historical balance, and statistical process control. In development, regression and impact tests compare a changed pipeline's outputs with the current version's.

Is data testing the same as unit testing?

No. A unit test checks one piece of code, such as a function or a single SQL model, often on inputs someone made up. A data test checks the data itself. In development, a regression test runs the whole pipeline on test data pulled from production and compares the outputs, which catches a renamed column that breaks a report three layers down. A unit test never sees that.

Is data observability a kind of data testing?

Yes, one kind. Data observability monitors many tables at ingestion for freshness, volume, schema, and drift, and it pings someone when a table looks wrong. It finds errors in production but does not stop them, and it does nothing for a code change in development. Stopping bad data takes a tripwire inside the pipeline, and catching a bad change takes regression tests.

What test data do you use for regression testing?

Data pulled from production, such as a filtered slice or a zero-copy clone, held fixed so that any difference in the output comes from the code change. DataKitchen's DataOps Is Not Just DevOps for Data paper calls test data management a first-order problem, because size, sampling, security, and licensing all decide whether a development environment can run the pipeline at all.

What should happen when a data test fails in production?

Set a severity on every test: hard fail, soft fail, or informational. A hard fail stops the pipeline and alerts the on-call engineer, and you should have very few. A soft fail lets the data through and warns the rule's named owner. An informational check records a number for the trend. DataKitchen's Guide to DataOps Tests says learned or statistical rules start as soft fails.

How many data tests does a team need?

More than anyone writes by hand. DataKitchen's Guide to DataOps Tests asks for two to three tests per table for freshness, volume, and schema, at least two per column, one custom test per business metric, and a check on every tool and job. For a Medallion architecture with about 200 tables, that is roughly 5,000 tests, which is why teams generate most of them from a data profile.

What are the best data testing tools?

Pick by who writes the tests. dbt tests, Great Expectations, and Soda Core run checks an engineer writes by hand. DataKitchen's open-source DataOps TestGen profiles your tables and generates tests from 36 test types, then runs them in production and from CI/CD. DataKitchen sells TestGen, so weigh that. DataKitchen's answer What are the best data quality testing tools in 2026? compares the field.

Try it on your own data

DataOps TestGen is free and open source. Profile a table and generate its tests this afternoon.