Fixing one thing often breaks another. Regression testing guards against that. Each time the code, a prompt, a model or a dependency changes, the system is run through a set of tests covering what already worked. If something that passed yesterday fails today, the change caused a regression and is fixed before release. For a buyer, a regression suite is what makes it safe to keep improving a system after launch.
How it works
A regression suite builds up as the project goes on. Each feature gets tests when it is built, and each bug, once fixed, gets a test so that it cannot return unnoticed. The suite usually runs automatically through a CI/CD pipeline whenever code changes, and again in a staging environment before release.
AI systems need two kinds of regression test:
- Code tests check the ordinary software: that integrations connect, data is saved correctly and errors are handled. These pass or fail cleanly.
- Behaviour tests check the AI's outputs. A change of prompt or model version can improve some answers and worsen others. Running evals on a fixed golden dataset shows whether the overall score held, and which cases changed.
The second kind matters more than many buyers expect. A small wording change to a prompt can quietly alter how a model handles edge cases, and without a fixed set of examples nobody notices until a user complains.
What it means for cost
Writing tests adds time to a build, so quotes that include a real test suite will usually be higher than those that do not. The saving comes later: each change can be made and checked quickly, instead of being followed by manual checking or user-reported bugs. Systems with no tests tend to become expensive to change, which is one of the main causes of technical debt.
Ask a builder:
- Will the system have automated tests, and what do they cover?
- How are prompt and model changes tested?
- Do tests run automatically on every change?
- Will we receive the tests at handover and be able to run them?
Common mistakes
Testing only the happy path. Treating AI outputs as untestable because they vary. Letting failing tests be switched off to meet a deadline.
Common questions
Why do AI systems need regression testing if the code has not changed?
Because behaviour can change without code changes. A provider may update the model, or a prompt may be edited in a settings screen. Re-running behaviour tests on a fixed set of examples catches these shifts.
How long does it take to build a regression suite?
It grows alongside the system, so the cost is spread over the build rather than paid in one block. Adding tests to a system that was built without them is slower and costlier, because the builder must first work out what the system is supposed to do.