AI-Generated Validation Can Pass While Data Is Still Wrong

An AI assistant generated sensible checks for a customer table — nulls, ranges, types, uniqueness, allowed values. Everything passed. The data was still wrong: the missing rule was not technical, it was semantic.

Customer Lifecycle Semantic Rules State Transitions Humans Define Quality

TL;DR: An AI-generated validation suite can pass while the data is still wrong. Technical validity is necessary, but business validity is the real goal — AI can generate checks, humans define quality.

The Problem

I asked an AI assistant to write a data-validation suite. It generated sensible checks: no nulls in key IDs, revenue within a valid range, unique records where expected, valid date formats, and accepted categorical values. Then I ran the validation. Everything passed.

And the data was still wrong. The missing rule was not technical — it was semantic. The dataset contained a customer state that was impossible in the real business process: a customer marked as churned also had a new activation event recorded earlier in the same lifecycle.

The Approach

No null check, range check, type check, or autogenerated expectation can reliably infer that rule without someone explaining how the business process actually works. That is the right way to think about AI-generated validation code.

AI is useful for generating the scaffold: repetitive validation syntax, standard null, type, range, and uniqueness checks, initial test-suite structure, and documentation and naming conventions.

But the highest-value quality rules usually require context. In this case, the rule was a lifespan constraint: a reactivated status can only follow a churned status through an approved transition. After a customer reaches churned, a later activated event is allowed only if an approved reactivated transition exists in between.

Outcome

Adding the semantic rule made the impossible record fail correctly: FAIL — lifecycle_transition_violation. The same principle applies to every business question: can this status follow the previous status? Can a contract end before it starts? Can revenue exist before activation? Can this event occur after an account is closed?

The assistant can express a rule. It cannot reliably decide which business rules matter. So yes: let AI remove validation boilerplate — but keep ownership of the definition of “valid” with the people who understand the data and the process behind it.

Key Takeaway

Design insight: An AI-generated validation suite can pass while the data is still wrong. Technical validity is necessary, but business validity is the real goal — AI can generate checks, humans define quality.

FAQ

What is the key takeaway from "AI-Generated Validation Can Pass While Data Is Still Wrong"?

An AI-generated validation suite can pass while the data is still wrong. Technical validity is necessary, but business validity is the real goal — AI can generate checks, humans define quality.

Who wrote this and what is it about?

This was written by Mahmoud Trigui, Senior Data Scientist. AI validation can pass while the data is still wrong: the missing rule is semantic — and only business owners can define it.

Comments

ForecastingTime SeriesMachine LearningPredictive ModelingFeature EngineeringNLPLLM ApplicationsDocument AICustomer SegmentationTelecom AnalyticsAnomaly DetectionRecommendation SystemsGraph AnalyticsGeospatial AnalyticsStatistical AnalysisExperimentation & A/B TestingPythonRSQLDataikuShiny DashboardsStreamlit AppsData VisualizationProduction MLModel EvaluationDecision SystemsData AutomationBusiness Analytics