Teams building AI agents can adapt test-driven development by writing an evaluation before they implement a new behavior. LangChain calls the approach eval-driven development: define what success and failure look like, create representative examples, establish a baseline, then compare every change against the same evidence.
Unlike ordinary software tests, agent evaluations must allow for variable wording, different valid answers and self-directed tool use. Deterministic checks work for facts such as whether the right tool was called, while an LLM judge may be needed for less mechanical qualities. LangChain recommends checking judges against human ratings before trusting them.
The method also guards against a common trap. A change can raise an average score while breaking an existing case. In LangChain’s example, adding an IT ticket tool handles repair requests but initially files tickets for simple how-to questions. Comparing individual examples reveals the regression and points to an overly broad tool description.
Teams can run fast checks on pull requests, slower judges nightly and production evaluators on sampled live traces. Real failures then become new dataset examples. A held-out set is still necessary because repeatedly tuning against the visible cases can produce an agent that passes its test suite without generalizing to new requests.