How do you automate data testing?

To automate data testing, generate the tests from a profile of your data, run them on a schedule or from your pipeline, and route failures to an owner. DataKitchen's open-source DataOps TestGen does all three: it profiles your tables, generates tests and monitors, runs them by schedule or API call, and alerts the owner you name for each table.

Key points

  • Writing tests is the part to automate first: 2,500 hand-written tests at an assumed 30 minutes each is 1,250 hours.
  • TestGen profiles 60 characteristics per column and generates tests from 36 test types, which DataKitchen estimates covers about 80 percent of the tests you need.
  • Freshness, volume, schema, and metric monitors need no rules. They cover every table you point them at.
  • TestGen's open-source edition includes an MCP server with 117 tools, so an AI assistant can read your profile and draft business rules.
  • TestGen is open source under Apache 2.0 and free for one user, one database connection, and one project, with unlimited tables.
Column profile bars feeding an arrow into a grid of sixteen generated tests, fifteen passing and one flagged amber
Generate the routine tests from a profile of your data, then write only the business rules.

What “automated” has to mean

Running hand-written tests on a schedule automates the easy half. The expensive half is writing the tests.

DataKitchen’s Guide to DataOps Tests asks for two to three tests per table. Take a bronze layer of 100 tables averaging 10 columns. That needs roughly 200 table tests and 2,000 column tests (about two per column). A full Medallion architecture needs about 5,000. Say you hand-write 2,500 tests, a scenario between those two figures. At an assumed 30 minutes each (an assumption, not a measured figure), that takes 1,250 hours.

Nobody has 1,250 hours. In my experience, coverage stalls at the handful of tables that already burned somebody, and the rest run untested.

Two bars at an assumed 30 minutes per test: hand-writing all 2,500 tests takes 1,250 hours; generating about 80 percent and hand-writing the 500 business rules takes 250 hours of writing
At an assumed 30 minutes per test. The 80% is DataKitchen's generation estimate; generated tests still need a review.

Automating data testing means automating three things: creating the tests, running them, and acting on the results. Steps 1 to 3 create tests and monitors, Step 4 runs them, and Step 5 acts on results.

Five steps in three phases: create (1 generate tests from a profile, 2 monitor every table with no rules, 3 write only the business rules), run (4 run where the data moves), act (5 route failures to an owner)
Five steps: three create the tests and monitors, one runs them, one acts on the results.

Step 1: Generate the routine tests from a profile

TestGen profiles every column in your database. It measures 60 characteristics per column and flags 32 kinds of data hygiene issue. Then it generates tests from 36 test types, based on what the profile found. Nobody hand-writes YAML or Python to get that coverage. To see every check TestGen can run, sorted by the symptom it catches and how much setup it needs, filter the Periodic Table of Data Quality.

DataKitchen estimates that generation covers about 80 percent of the tests you need (the reasoning is in No Python, no SQL templates, no YAML). The rest needs your knowledge of the business.

You review generated tests in TestGen’s web UI, where engineers, data stewards, and business users see profiles, tests, monitors, and results. For each test, you accept it, adjust it, or turn it off. Generated tests are built from your data as it is today, so a problem already in the data can look normal. Review is where you catch that.

Step 2: Put monitors on every table

Freshness, volume, schema, and metric monitors need no rules. They cover every table you point them at, and they watch for late loads, unusual row counts, schema changes, and shifts in a metric.

If you’re deciding what to set up first, read data quality testing or data observability: which first.

Step 3: Write only the business rules, and let an assistant help

A generated test describes the data you have. It can’t know what the data should mean. That part is the business rules, and you can get a head start on them.

TestGen’s MCP server has 117 tools in the open-source edition. Connect an AI assistant and it reads the profile and drafts rules under your own role. You review what it drafts, the same way you review generated tests.

In DataKitchen’s 2026 NYC taxi test, 62 generated tests passed on a 300,000-row sample. What the AI-written rules caught is on Can AI write data quality tests?.

Step 4: Run them where the data moves

Tests only help if they run where the data moves. The Guide names four places to test: source data, ingestion, production tripwires between steps, and regression tests in development.

TestGen runs test suites from Airflow, GitHub Actions, GitLab CI, or Azure DevOps through its REST API. Your job starts a run, polls until it finishes, and fails the pipeline when a test fails. Tests set to Warning severity report without blocking, so a soft problem doesn’t stop a release.

The Airflow setup is in How to run TestGen from Airflow. For release gates, see How to run data tests in CI/CD before an analytics release. The API calls are in the TestGen docs.

Step 5: Route failures to a person

Notifications go to email, Slack, Microsoft Teams, or a webhook. Name an owner for each table, so every alert has someone who answers it.

An alert with no owner just piles up in a log.

What automation won’t do

A person who knows the business decides which business rules matter and says what a value should look like. An assistant drafts those rules for review.

An engineer or steward finds the cause of a failure and repairs the data. A failed test tells you where to look.

How the approaches compare

ApproachWho writes the testsHow they runFit
Hand-written SQL checksYou, one query at a timeWhatever scheduler you wire upA handful of critical tables. Flexible, but the 1,250-hour scenario above applies.
dbt testsYou, in YAML per modeldbt buildTeams already in dbt. Good at keeping checks next to the model they guard. See When are dbt tests enough?
Great Expectations and Soda CoreYou, as checks in Python or YAMLFrom your orchestrator or scriptsTeams that want detailed, hand-authored checks as code. Soda Core has been source-available under the Elastic License 2.0 since January 2026.
DataKitchen TestGenGenerated from a profile, plus monitors. You add business rules.On a schedule or through the REST APITeams that want coverage without writing every test.

Start with TestGen

TestGen is open source under Apache 2.0. The open-source edition is free for one user, one database connection, and one project, with unlimited tables. Install TestGen and profile one schema to see what it generates.

TestGen Enterprise costs $100 per user per month plus $100 per database connection per month. Details are on the pricing page.

For the definitions behind all of this, see What is data testing?

Frequently asked questions

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

Can I automate data testing without writing tests?

Mostly. TestGen generates tests from a profile of your data using 36 test types, which DataKitchen estimates covers about 80 percent of the tests you need. You still write the business rules, because only you know what the data should mean. An AI assistant connected through TestGen's MCP server can draft those rules for you to review.

How many data tests do I need?

DataKitchen's Guide to DataOps Tests asks for two to three tests per table. A bronze layer of 100 tables averaging 10 columns needs roughly 200 table tests and 2,000 column tests. A full Medallion architecture needs about 5,000. Hand-writing 2,500 of them would take 1,250 hours at an assumed 30 minutes each.

How do I run automated data tests in my pipeline?

Call TestGen's REST API from Airflow, GitHub Actions, GitLab CI, or Azure DevOps. Start a run, poll until it finishes, and fail the pipeline when a test fails. Tests with Warning severity report without blocking the pipeline. The request details are in the TestGen docs under "Run profiling and tests."

Is TestGen free?

The open-source edition is free under Apache 2.0 for one user, one database connection, and one project, with unlimited tables. TestGen Enterprise costs $100 per user per month plus $100 per database connection per month. Both editions include the web UI, and the open-source edition includes the MCP server with 117 tools.

Do I still need dbt tests if I automate with TestGen?

Not necessarily, and you can run both. dbt tests are written in YAML per model and run with dbt build, which suits teams already in dbt. Keep them on the models you already cover. Let TestGen generate tests and monitors for the tables nobody has had time to reach.

Try it on your own data

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