Test in Production is the practice of executing a curated suite of non-destructive data quality checks directly on live, operational data to monitor its health and catch issues that may not manifest in pre-production environments. This approach complements traditional pre-deployment testing by providing continuous validation against real-world data distributions, volumes, and usage patterns. It is a critical component of Data Observability, enabling proactive detection of anomalies like data drift, schema violations, and broken business logic before they degrade downstream analytics and machine learning models.
Glossary
Test in Production

What is Test in Production?
A core practice in modern data engineering for validating live data.
Implementation typically involves pipeline-gated tests and canary tests that run after data ingestion or transformation, using frameworks like Great Expectations or dbt Test. These checks validate data quality rules against dynamic thresholds and aggregate results for monitoring. The goal is not to replace staging tests but to create a safety net that ensures data reliability engineering principles are maintained throughout the data lifecycle, providing engineers with real-time telemetry on the state of their most critical asset.
Key Characteristics of Test in Production
Test in Production involves executing non-destructive quality checks directly on live data to monitor its health, detect issues that only manifest in real-world environments, and ensure continuous data reliability.
Real-World Validation
Unlike pre-production testing, Test in Production validates data against the full complexity and scale of live systems. This catches issues that synthetic or sampled test data cannot reveal, such as:
- Data drift caused by evolving user behavior.
- Integration failures with external, real-time data sources.
- Performance degradation under actual query loads and concurrency.
Non-Destructive Monitoring
These tests are designed to be observational and read-only, ensuring they do not alter, corrupt, or impact the performance of the production data pipeline. Techniques include:
- Executing validation queries on replicas or during off-peak hours.
- Using sampling to check a subset of recent records.
- Implementing canary tests that validate new logic on a small percentage of live traffic before full deployment.
Continuous Feedback Loop
Test in Production creates a closed-loop system for data quality, providing immediate feedback on the health of live data. This enables:
- Proactive alerting on schema changes, freshness violations, or anomaly detection.
- Validation of business logic (e.g., revenue calculations) using actual transaction data.
- Integration with incident management tools to automatically create tickets for data engineers when thresholds are breached.
Dynamic Thresholds & Statistical Control
Instead of relying on static rules, production tests often use dynamic thresholds derived from historical data patterns. This involves:
- Applying statistical process control (SPC) charts to monitor metrics like row counts or aggregate values.
- Using machine learning models to predict expected ranges and flag outliers.
- Automatically adjusting alerting sensitivity based on seasonal trends or known business cycles (e.g., holiday sales spikes).
Complement to Pre-Production Testing
Test in Production does not replace traditional unit tests or integration tests; it complements them. The testing strategy forms a layered defense:
- Pre-Production: Validate transformation logic and schema with controlled data.
- Deployment: Use smoke tests and canary releases.
- Production: Monitor for real-world drift, freshness, and business rule adherence. A failure in production tests often triggers a rollback or fix, which is then validated by the pre-production suite.
Tooling & Integration
Effective implementation relies on specialized frameworks and platforms that integrate with the data stack. Common capabilities include:
- Declarative test suites (e.g., in Great Expectations or dbt) that can run in both staging and production.
- Pipeline-gated tests that can halt a workflow if critical quality checks fail.
- Observability dashboards that aggregate test results, showing pass/fail rates and trends over time.
- Orchestrator triggers (e.g., in Apache Airflow) that execute validation jobs after key pipeline tasks complete.
How Test in Production Works
Test in Production is a critical practice in modern data engineering where automated quality checks are executed directly on live data.
Test in Production is the practice of executing a curated suite of non-destructive data quality checks directly on live production data streams and datasets. Unlike traditional testing confined to staging environments, this approach validates data health in its real-world context, catching issues like data drift, schema violations, and business logic errors that may only manifest under actual load and usage patterns. It complements, rather than replaces, pre-production testing by providing continuous monitoring.
Implementation typically involves pipeline-gated tests that run after data ingestion or transformation, using frameworks like Great Expectations or dbt. These data quality gates validate metrics such as freshness, volume, and distribution against dynamic thresholds. Results are aggregated for observability, triggering alerts or automated rollbacks if anomalies are detected, thereby preventing corrupt data from degrading downstream models and analytics. This practice is a core tenet of Data Reliability Engineering.
Common Use Cases and Examples
Testing in production is a pragmatic strategy for validating data quality where it matters most. These cards detail specific scenarios where this practice is essential for ensuring live data integrity.
Monitoring Data Drift in ML Features
This is a primary use case where test in production is non-negotiable. Machine learning models can degrade silently when the statistical properties of their input features change. Running lightweight statistical tests on live feature data is critical to detect:
- Concept Drift: Changes in the relationship between features and the target variable.
- Covariate Shift: Changes in the distribution of input features themselves.
- Data Integrity Issues: Sudden spikes in null rates or out-of-range values in live inference data. Examples include monitoring the average transaction amount for a fraud model or the distribution of user ages for a recommendation system. Catching drift early prevents costly model performance decay.
Validating Real-Time Data Pipelines
For streaming architectures (e.g., Apache Kafka, Apache Flink), testing only in staging is insufficient. Test in production validates that real-world volume, velocity, and network conditions don't break assumptions. Key checks include:
- Latency SLOs: Verifying that 95th percentile processing time remains under a threshold (e.g., < 100ms).
- End-to-End Freshness: Confirming data flows from source to sink within the required business window.
- Schema Evolution Handling: Ensuring live schema changes from upstream services (like Protobuf or Avro updates) are consumed without causing pipeline failures or data loss. This practice catches concurrency bugs and resource saturation issues that only manifest under true production load.
Canary Releases for Data Products
Applying the canary release pattern to data involves routing a small percentage of live traffic to a new data pipeline or transformation. Test in production is used to compare the canary's output against the stable version. This validates:
- Business Logic Parity: Ensuring a new aggregation or calculation yields statistically equivalent results.
- Performance Impact: Monitoring for increased CPU/memory usage or query latency.
- Downstream Compatibility: Verifying that consuming dashboards or APIs continue to work with the new data format. If data quality tests pass, traffic is gradually increased; if they fail, the canary is rolled back, minimizing blast radius.
Enforcing Data Contracts on Live APIs
Data contracts define the schema, semantics, and service-level objectives for data products. Testing in production enforces these contracts on live APIs and streaming endpoints. This involves continuous validation that:
- API Responses adhere to the promised JSON schema and data types.
- SLAs for uptime and p95 latency are being met.
- Semantic Rules are maintained (e.g., a
customer_idfield in the response always corresponds to a valid record in the master database). Tools like schemathesis or custom middleware run these contract tests, providing immediate alerts if an upstream service breaks its contract and threatens downstream data consumers.
Business Metric Sanity Checks
This use case involves running high-level, non-invasive tests on key business metrics generated in production. The goal is to catch catastrophic errors that slip past unit tests. Examples include:
- Daily Active Users (DAU): Testing that the count is non-negative and within a plausible range based on historical trends (e.g., not a 90% drop).
- Revenue Totals: Validating that aggregate revenue for the day is positive and aligns with order volume.
- Geographic Distributions: Ensuring the percentage of users from a major region doesn't inexplicably fall to zero. These tests often use dynamic thresholds based on rolling averages or statistical process control limits, rather than hard-coded values.
Post-Deployment Regression Testing
After deploying a change to a data pipeline or platform, test in production acts as the final regression safety net. It answers the question: "Did my change break anything in the live environment?" This involves:
- Smoke Tests: Running a critical subset of data quality checks immediately after deployment to verify core functionality.
- Data Diffing: Comparing a sample of outputs from the new pipeline version against the previous version's outputs (or a golden dataset) to identify unintended changes.
- Integration Health Checks: Validating that all downstream dependencies (dashboards, ML models, exports) can still successfully read and process the new data. This practice closes the feedback loop between development and operational reality.
Test in Production vs. Staging Environment Testing
A comparison of two core data testing strategies, highlighting their distinct purposes, risk profiles, and operational characteristics within the data engineering lifecycle.
| Feature / Characteristic | Test in Production | Staging Environment Testing |
|---|---|---|
Primary Objective | Monitor real-time health and quality of live data; catch issues absent from synthetic/static test data. | Validate pipeline logic, transformations, and integration before deployment to production. |
Data Under Test | Live, continuously updating production data streams and datasets. | Static, synthetic, or anonymized snapshots of production data. |
Test Scope & Focus | Non-destructive checks on data quality, freshness, volume, and statistical properties (e.g., drift, anomalies). | Comprehensive validation of code, schema, business logic, and end-to-end pipeline functionality. |
Risk of Data Corruption | Low (tests are read-only or use isolated shadow writes). | None (environment is fully isolated from live systems). |
Ability to Catch Environment-Specific Issues | High. Detects issues caused by real-world scale, concurrency, and external dependencies. | Low. Cannot replicate exact production load, data variety, or integration states. |
Feedback Loop Speed | Immediate. Provides real-time or near-real-time alerts on data health. | Pre-deployment. Feedback is received before changes impact live systems. |
Cost & Infrastructure Overhead | Minimal incremental cost; leverages existing production infrastructure. | Significant. Requires dedicated, scaled-down replica of production stack (compute, storage, networking). |
Typical Test Types | Data quality assertions, statistical process control, anomaly detection, canary tests. | Unit tests, integration tests, regression tests, smoke tests using golden datasets. |
Required Safety Mechanisms | Mandatory: feature flags, careful test design, observability, and rollback plans. | Optional. Failures are contained within the isolated environment. |
Frequently Asked Questions
Direct answers to common technical questions about the practice of executing data quality checks directly on live production data to ensure ongoing integrity and catch issues missed in pre-production.
Testing in production is the practice of executing a curated suite of non-destructive data quality checks directly on live, operational data to monitor its health, validate business logic, and detect anomalies that may not manifest in isolated test environments.
Unlike pre-production testing which uses static or synthetic datasets, this approach validates data against real-world conditions, volumes, and upstream dependencies. It is a critical component of a Data Observability strategy, acting as a final, continuous verification layer. The checks are designed to be non-invasive, meaning they do not alter, delete, or lock production data. Common frameworks enabling this include Great Expectations, dbt tests, and Soda Core, which can be scheduled or triggered by pipeline events to run assertions on freshness, volume, schema, and custom business rules.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Test in Production is one component of a broader strategy for ensuring data integrity. These related concepts define the frameworks, methodologies, and specific tools used to build robust, automated data quality systems.
Data Contract
A formal, often code-based agreement that specifies the expected schema, data types, freshness, and quality guarantees for a data product. It establishes a clear interface between data producers and consumers, serving as the foundational specification against which tests (including those in production) are written.
- Key Elements: Schema definition, SLAs for latency, semantic versioning for changes.
- Purpose: Prevents breaking changes, enables independent development of upstream and downstream systems.
- Example: A Kafka topic's Avro schema and a guarantee of 99.9% event delivery within 5 seconds.
Data Quality Rule
A declarative or programmatic statement that defines a condition data must satisfy to be considered valid. These rules are the atomic units of data testing.
- Types: Schema rules (column exists, correct data type), statistical rules (value within range, non-null), and business logic rules (customer_age < 150).
- Implementation: Can be written in SQL (
SELECT COUNT(*) FROM table WHERE column IS NULL), YAML (for tools like Soda Core), or Python (for frameworks like Great Expectations). - Production Use: A subset of these rules, often monitoring freshness and volume, are executed as Test in Production checks.
Assertion (Data)
A programmatic check embedded within a data pipeline that verifies a specific condition and raises an error or warning if false. It is the operational execution of a Data Quality Rule.
- Mechanism: Typically implemented as a step in an orchestration tool (e.g., Airflow, Dagster) or within a transformation script.
- Outcome: Can be blocking (fails the pipeline) or non-blocking (logs a warning for monitoring).
- Example in Production: After a daily batch load, an assertion checks if the row count is within 10% of yesterday's count. A failure triggers an alert but does not roll back the load.
Pipeline-Gated Test
A data quality test whose failure prevents a data pipeline from proceeding to the next stage. It acts as a strict quality gate to block corrupted or invalid data from propagating.
- Contrast with Test in Production: Gated tests are typically run in development or staging environments before data is promoted to production. Test in Production monitors live data after it has passed these gates.
- Common Gates: Schema validation, primary key uniqueness, referential integrity checks.
- Tool Integration: Implemented in CI/CD pipelines or orchestration frameworks like Apache Airflow using sensors or custom operators.
Canary Test (Data)
A deployment and testing strategy where new data or a new pipeline transformation is released to a small, controlled subset of the production environment first. Data quality tests are then executed on this canary data to validate behavior before a full rollout.
- Relationship to Test in Production: A specialized, proactive form of testing in production used for change validation. It mitigates risk by limiting the blast radius of a bad deployment.
- Process:
- Route 5% of production traffic to the new pipeline version.
- Run a suite of validation tests on the output.
- If tests pass, gradually increase traffic to 100%.
- Use Case: Validating a new machine learning model's inference output on live user data.
Data Quality as Code
The practice of managing data quality rules, test configurations, and validation logic using version-controlled code (e.g., SQL, Python, YAML). This enables automation, peer review, reproducibility, and seamless integration into engineering workflows.
- Core Principles:
- Version Control: Tests are stored in Git, enabling rollback and audit trails.
- CI/CD Integration: Tests run automatically on pull requests and deployments.
- Environment Parity: The same test definitions can be run in development, staging, and production.
- Frameworks: Great Expectations (Python), dbt Test (SQL/YAML), and Soda Core (YAML) are built on this principle.
- Benefit for Test in Production: Ensures the checks monitoring live data are identical to those validated during development, eliminating configuration drift.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us