The Best Testers Are Not Trying to Prove Anything

When we talk about software testing, we tend to talk about process. Test cases, automation, coverage, defects, entry and exit criteria. We talk about the things we do. But looking beyond technique, beyond all of those activities, is a more fundamental question: what are we actually trying to achieve when we test and why are we doing it?

Several years ago, while putting together a presentation on the philosophy of science and software testing (which sadly never saw the inside of a conference hall), I wrote that software testing is fundamentally concerned with gaining knowledge about the system you are testing. At the same time, science is also concerned with gaining knowledge about systems under investigation. That similarity gives us a useful reason to look at the philosophy of science and ask whether it can tell us something about what we are really doing when we test.

Which brings me to Karl Popper. Karl Popper was an influential post-war Austro-British philosopher most famous for two main ideas: his paradox of tolerance and falsifiability as the basis for science.

One of Karl Popper’s most influential contributions to the philosophy of science was the idea of falsifiability. He posited that a scientific theory can never be proven right because a new piece of evidence could come along and upset it. But a theory can be proven to be wrong; to be valid, a theory must be able to make predictions that can be tested. If these predictions are correct, the theory isn’t proven true, but we can have a lot more confidence in it. If they’re incorrect, the theory is wrong and needs to change or be scrapped. This is falsifiability.

Let’s circle back to software, where, like science, we are investigating if a system works. You can’t test everything; you can only increase your confidence in the system.

Imagine that we have tested a system one thousand times and every test has passed.

What have we proved? Not as much as we might like. Importantly, we haven’t proved that the software is defect-free. To be honest, we haven’t even proved that it will work the next time we use it, particularly with AI-enabled systems. What we have done is increased our confidence that the system works.

The next test might still expose the counterexample.

We can never prove software is defect-free; we can only run tests to increase our confidence in it.

That distinction between proof and confidence seems to me to be key to testing.

Our job isn’t to prove that the software works because, fundamentally, we can’t; but we can ensure that we have sufficient confidence in it and that we have tested it to our organisation’s appetite for risk. In any complex system, we can never really test everything. I was talking about this over a pint with an old friend who happens to be an embedded systems developer. I pointed out that there are scenarios that are really edge-case, such as a cosmic ray flipping a bit. He instantly got it; he’d worked on safety-critical avionics in the past and told me about how this was a real issue due to the loss of atmospheric protection on planes. Incidentally, for those who are interested, there are a number of ways of addressing this, such as Triple Modular Redundancy, where three computers run the same programme simultaneously. If one gives a different answer, it’s automatically rebooted.

A test should give us an opportunity to be wrong

There is another interesting implication here. If we approach testing with the intention of demonstrating that a system works as we theorise it should, it is quite easy to construct evidence that supports that belief. What do I mean by that? Well, we can explore the happy path. We can select representative examples. We can run the tests we expect to pass. We can point to a reassuring collection of green ticks.

None of that is necessarily bad testing, but it becomes dangerous when we start confusing supporting evidence with proof.

This leads to a much more interesting testing question: what evidence would change our mind?

A serious test of a theory, or a software system, must allow it every opportunity to fail. Indeed, we must look for failure modes.

That sounds philosophical, and it is, but testers already do this. Or at least, good testers do. If somebody tells us that an application can support 10,000 concurrent users, the interesting test isn’t one that demonstrates it can support 100. It’s when we look at 10,000, and then 10,001.

Testing becomes valuable when the evidence has a genuine opportunity to contradict our assumptions.

That is why I think the best testers are not really trying to prove anything. They are trying to find the point at which the thing they have been told stops being true.

Knowing when we have tested enough

There is an obvious problem with all this, though: we can’t test forever. If every successful test only increases our confidence rather than proving that the software is correct, theoretically we could just keep testing.

In practice, someone has to make a decision…

  • Do we release?
  • Do we accept the system?
  • Do we put it into production?

This is where falsification connects directly with risk. We can keep making predictions about our system, about what we’re examining, and challenging them, but at what point do we say we have tested enough? The question isn’t just: Has the software passed its tests?

It’s more: Have we challenged our assumptions sufficiently, given the consequences if those assumptions are wrong?

That is a rather different way of thinking about test coverage. A failure in a little-used internal function might be irritating. A failure affecting financial data, personal information, or a critical business process could be considerably more serious.

Both systems might have passed 95% of their tests. That number by itself doesn’t tell us whether we should be equally confident in releasing them. Testing is not simply about accumulating passes. It is about accumulating appropriate evidence against the risks we are being asked to accept.

Putting falsifiability to the test with AI

This all became rather less theoretical for me recently. As I’m constantly banging on about, I’ve been involved in evaluating whether AI could help us create User Acceptance Testing test cases. We started with what appeared to be a fairly straightforward question: could AI create useful UAT tests?

Like many experiments involving AI, it would have been relatively easy to answer that question positively. Give an AI tool some good source material, create an impressive set of tests, tidy the prompt a little, and there you go. AI can create UAT tests.

But that isn’t a particularly strong experiment. The more interesting question was whether you design the evaluation so that the proposition “AI can usefully create UAT tests” has a realistic opportunity to fail.

Does your AI pilot try to discover when AI is unsuitable, or only gather evidence that adoption should continue?

In my study, our results weren’t consistently good. Similar approaches produced substantially different results depending upon the project information available. Instead of treating those results as an inconvenience and continuing to optimise prompts and models, these results caused me to reconsider what I thought we were measuring. The quality, specificity, and coherence of the information available to the AI emerged as an important explanatory factor.

The experiment became more useful because the original assumption was allowed to fail. Failure, in that sense, wasn’t a bad result. It was the result that taught us something.

A little Popper for Monday morning

You don’t need to have read The Logic of Scientific Discovery to put this into practice. Before starting any test, experiment, or Proof of Concept, ask yourself:

  1. What do we currently believe? (Assumption)
  2. What should we observe if that belief is correct? (Risky prediction)
  3. What evidence would make us reconsider it? (Falsifying result)
  4. What is the smallest credible test that gives us the opportunity to be wrong? (Controlled comparison)

Of all these, the third question is the real litmus test: What evidence would make me change my mind?

If the honest answer is nothing, you aren’t testing. You’re just trying to prove yourself right—and Karl Popper would have plenty to say about that.

Popper isn’t the end of this particular philosophical rabbit hole. Next, I’m going to look at Lakatos and Kuhn, and whether the changes AI is bringing to software testing really amount to the “paradigm shift” we keep hearing about.

Published by Bill Watson

Bill Watson's first computer was a Dragon 32 in the early 1980s, which involved copying code from ZX Spectrum magazines and learning debugging the hard way. Today he works as a Test Manager at the BBC, running User Acceptance Testing and Business Acceptance Testing activities across enterprise IT projects. A regular conference speaker, Bill is particularly interested in the practical application of AI in testing, and in separating evidence from hype. Through this blog series he is documenting his journey evaluating AI generated UAT test cases and developing frameworks to help organisations understand when AI is likely to add real value.

Leave a Reply