Expertise hub / Testing
Testing 9 min read

Why traditional testing doesn't work for AI systems

Press the button, compare with the expected result, pass or fail. That model has worked for software for fifty years. For AI systems, it no longer works. That's not a matter of testing more, but of testing differently.

For AI systems, that model hits a fundamental problem: there's no fixed expected result to check against. That may seem like a technical detail, but it changes everything about how you assess test quality.

The oracle problem

A test case needs an oracle: a way to determine whether the outcome is correct. With traditional software, that's straightforward: the specification describes exactly what the output should be. With a machine learning model, the output is a prediction, not a calculation. Two correct models can give a different, equally defensible answer to the same input.

01

No fixed expected result

A model predicts a probability, not a certainty. "Wrong" and "unexpected" are not the same thing.

02

Behaviour depends on data

Same code, different training data, different behaviour. The test baseline shifts with every retraining.

03

Quality changes after delivery

A test that passes today can fail in three months, without anything about the model changing.

That last point is the most unfamiliar for most teams: software you don't touch normally keeps doing what it did. A model you don't touch can gradually perform worse because the world around it changes. More on that in our article on model drift.

The difference isn't "test more". It's a different question: not "is this answer correct", but "is this behaviour acceptable, consistent, and within expected limits".

What actually works

What doesn't change

The components around the model (the API that calls it, the database that stores results, the interface that displays them) remain plain deterministic software. You test those the way you always did. It's only the model itself that needs a different approach. Those who don't make that distinction either test too little on the model, or far too much on the rest.

An example from practice

At a client with a text-classification model for customer feedback (positive, neutral, negative), a classic test using a fixed list of "expected" classifications kept failing after every model update, without the model actually performing worse. Each retraining shifted things just enough to break exact matches.

// Instead of expecting an exact match, // we test a metamorphic relation: original: "Delivery was slow but the quality was great." → classification: mixed/neutral modified: "Delivery was VERY slow but the quality was great." → expectation: classification stays mixed/neutral, or shifts slightly more negative, but must not flip to "positive"

Instead of checking whether the model returns exactly the label "neutral," we check whether a logical intensification of sentiment (slow → very slow) doesn't push the classification against expectation. That test survives a retraining; an exact-match test doesn't.

What this delivers in practice

// A different approach, not an ad-hoc fix

Sure your AI system has been thoroughly tested?

We review your testing approach and show you where "it works on my test set" falls short.

Book a call
// Read also