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 production | Data testing in development | |
|---|---|---|
| What’s fixed | The code, which changes only through a release | The data: test data pulled from production, such as a filtered slice or a zero-copy clone |
| What changes | The data, new every run | The code: your change, a new model, a dependency upgrade |
| What a failure means | The data is wrong: a bad source, a failed load, a tool that broke | Your change broke something that worked, or moved a number it shouldn’t |
| When it runs | Every pipeline run, between processing steps and on a schedule | On every change, in CI/CD before the merge or deploy |
| Example tests | Freshness, row count ranges, nulls in keys, location and historical balance, schema drift | The full pipeline run in QA, with row counts, null rates, and key metrics compared before and after |
| What happens on failure | A hard fail stops the pipeline; a soft fail warns the rule’s owner | The build fails and the change doesn’t deploy |
| What it protects | The data you already have | The data your next deployment will produce |
| Related terms | Data monitoring, data observability, tripwires, shift-left testing | Regression 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.