Eval-Driven Development: Testing Software That Thinks

When AI outputs are probabilistic, pass/fail tests miss quality regressions. Evaluation frameworks are the quality loop — run them in CI or ship blind.

Traditional software quality rests on a simple premise: given the same inputs, the system produces the same outputs. Tests encode the expected output, the system either matches it or it does not, and the build pipeline enforces the contract. This model works because the logic is deterministic. The question is always whether the code did what it was supposed to do.

AI-native systems break this premise at the foundation. A language model queried twice with the same prompt can return different text. A retrieval pipeline that produces accurate results today can regress when the underlying data is updated. A prompt that works reliably with one model version may degrade after a provider update without any change to your code. The traditional test suite has no answer for any of this, because the failure mode is not a wrong answer — it is a right-shaped answer that is subtly worse than before.

In the closing synthesis of this campaign, we noted that evaluation infrastructure needs to be built before you need it. This post is about what that actually means: what evals are, why they replace the test suite as your primary quality instrument, and how to run them continuously without rebuilding your entire delivery process.

The test suite does not fail when your AI gets worse

This is the problem that catches most teams off guard.

A team builds a RAG pipeline for customer support. They ship it, it works well, they move on. Three months later, the product documentation is updated. Some articles are restructured, some terminology changes, and several outdated pages are removed. The pipeline still runs. The tests still pass. But the answers the agent gives are now less accurate because the retrieval is finding weaker matches for common queries.

Nothing broke. The code did what it was supposed to do. The quality degraded.

The same pattern appears with model providers. You are using GPT-4o for a planning agent. The provider ships an updated version of the model with improved safety constraints that are slightly more conservative on the kinds of instructions your agent issues. Your unit tests still pass because they test the tool calls, the schema validation, and the workflow logic — not the quality of the reasoning. But the agent now declines a class of subtask that it previously handled, and task completion rates drop.

These are not bugs in the traditional sense. They are quality regressions in a system where quality is probabilistic. The test suite cannot catch them because the test suite is checking for crashes and schema errors, not for whether the answers are good.

What evaluations actually are

An evaluation (eval) is a structured measurement of AI output quality against a defined criterion. It is not a test in the pass/fail sense. It is a measurement that answers: how good is this output, on this dimension, compared to a baseline?

The dimensions vary by system type:

Faithfulness. Did the model's response accurately represent the information it retrieved? A hallucination is a faithfulness failure — the output looks plausible but is not grounded in the source material.

Relevance. Did the retrieval pipeline surface the right context? A response can be faithful to what was retrieved while still being unhelpful because the retrieval was off-target.

Task completion. Did the agent successfully complete the goal it was given? This requires defining what success looks like for each task type, which is harder than it sounds.

Groundedness. Are the claims in the response traceable to a verifiable source? This matters most in high-stakes domains where the cost of a plausible-sounding error is high.

Format and schema. Did the output conform to the expected structure? This overlaps with traditional testing but is still worth treating as an eval dimension because model updates can shift default formatting in ways that break downstream processing.

Each of these is a metric, not a boolean. A response can be 90% faithful, or 60% relevant, or complete the task in 7 out of 10 cases. The eval pipeline measures these rates, tracks them over time, and surfaces when they move.

The evaluation tooling landscape

Three frameworks are doing the most useful work in this space.

Ragas is built specifically for RAG pipeline evaluation. It provides metrics for faithfulness (does the answer reflect the retrieved context?), answer relevance (does the answer address the question?), and context precision and recall (did the retrieval pipeline surface the right documents, and did it surface all of them?). Ragas uses an LLM-as-judge approach for the semantic metrics, with reference-free evaluation where ground truth is not available. It is the right starting point for teams with retrieval pipelines.

TruLens (now merged into TruEra) takes a broader view. It provides instrumentation for LLM applications through a feedback function model: you define a quality criterion, attach a feedback function that measures it, and TruLens runs the measurement as part of every evaluation pass. The dashboard surfaces metric distributions and correlations, which is useful for diagnosing which input categories produce the most quality degradation. TruLens integrates well with LangChain and LlamaIndex, which are common orchestration layers.

OpenAI Evals is a framework for evaluating model outputs against a test set. It is less oriented toward production monitoring and more toward structured comparison: given a set of inputs and expected outputs, how does the model perform? It is particularly useful for regression testing across model versions — running the same eval set against the current model and a new model version to detect capability shifts before you update.

These tools are not mutually exclusive. A mature AI-native team typically uses something like Ragas for continuous retrieval quality monitoring, TruLens for application-level quality tracking, and a structured eval set (in OpenAI Evals format or similar) for model version regression testing. The instrumentation layers solve different parts of the quality problem.

Running evals in CI

The structural recommendation here is straightforward: treat evals as a pipeline stage, not a post-deployment activity.

The practical objection is cost. LLM-as-judge evaluations use model inference, which has a per-call cost. Running full evals on every commit can get expensive fast. The practical resolution is to run different eval scopes at different pipeline stages:

Fast eval suite on every PR. A targeted set of 50-100 representative inputs covering your most critical task types. Run these on every pull request. The goal is to catch regressions before they reach staging, and the scope should be small enough to complete in under five minutes.

Full eval suite on merge to staging. A comprehensive set of 500-1000 inputs covering the full input distribution. This is slower and more expensive but catches coverage gaps the fast suite misses. Run it as a blocking gate before deployment to staging.

Continuous production monitoring. Sample real user sessions, run async quality checks on a percentage of live traffic, and surface metric distributions in a dashboard. This catches the drift scenarios that CI cannot catch — model provider updates, data changes, distribution shift in real queries.

The investment is front-loaded. You need to build the eval harness, define your quality criteria, and create representative test sets. But the ongoing operational cost is predictable once the infrastructure is in place, and the alternative — discovering quality regressions through customer complaints — is always more expensive.

The ground truth problem

One objection that comes up quickly in eval discussions is the ground truth problem: if you do not have a correct answer to compare against, how do you evaluate quality?

For some systems, you do have ground truth. A classification task has correct labels. A code generation task has tests that pass or fail. A retrieval task over a structured knowledge base has verifiable facts. In these cases, reference-based evaluation is straightforward — compare the output to the known answer.

For open-ended generation, the ground truth problem is real. There is no single correct response to most customer support queries, strategic questions, or synthesis tasks. This is where LLM-as-judge evaluation becomes the practical answer: use a separate, typically stronger model to evaluate the quality of outputs against a rubric. The judge model does not need the ground truth; it evaluates the response against criteria like faithfulness, relevance, and coherence.

LLM-as-judge is not perfect. The judge model has its own biases and limitations. But it scales to cases where human annotation is too expensive for continuous use, and when calibrated against a human-annotated validation set, it produces measurements that correlate well enough with human judgment to be actionable.

The other path is behavioral evaluation: rather than asking whether the output is correct, measure whether the system did the right thing. Did the agent call the right tools? Did it stay within its authorized scope? Did the workflow reach completion? These behavioral metrics can be measured without ground truth and are often more actionable than semantic quality scores because they diagnose failure modes at the system level rather than the output level.

What this changes about how you ship

Teams that run evals continuously change how they think about deployment decisions.

When a model provider announces a new version, you do not update and hope for the best. You run your eval suite against the new model version before updating, compare the score distributions, and identify any capability regressions in your task categories. If faithfulness drops on retrieval tasks, you know before it affects users.

When you change a system prompt, you run the fast eval suite before merging. When you update your retrieval index, you run the RAG quality metrics before deploying. When you add a new tool to your agent, you run behavioral evals to verify the tool is being called correctly and not being selected when it should not be.

This is eval-driven development: quality measurement is a loop, not a checkpoint. Evals run before you ship, evals run after you ship, and the metrics tell you whether quality is moving in the right direction.

The shift is analogous to what happened when continuous integration replaced manual QA cycles. The investment in automation felt like overhead until teams discovered that finding bugs at commit time was an order of magnitude cheaper than finding them in production. Evals make the same trade for AI-native systems: the investment in evaluation infrastructure pays off at the quality regression you catch before it reaches a customer.

As we noted in the roadmap piece, teams that build evaluation infrastructure before they need it are the ones that can let agents handle consequential tasks at scale. The quality loop is what earns that trust.

If you are shipping AI-native products today without evals in your pipeline, you have a quality system you cannot see. You know how fast the system is. You know whether it returns errors. You do not know whether it is getting better or worse at the thing it was built to do. Evals close that gap. They are not optional instrumentation for mature teams — they are the instrument that makes maturity possible.

Want to learn more?

We write about AI, product strategy, and the future of building. Get in touch to continue the conversation.

Start a conversation →