When I was at KWSQA last month, I sat in on half of Paul‘s session. To illustrate that I still don’t know all the folklore, he explained the Minefield Problem to the group and that particular analogy was new to me. Not the concept, but the presentation of it.

James Bach appears to be the originator of it in his mini-essay Reasons to Repeat Tests. And now, having read it, I vaguely think I remember this part of the RST course, but don’t remember the minefield illustration. Here is the section that frames the problem:

Testing to find bugs is like searching a minefield for mines. If you just travel the same path through the field again and again, you won’t find a lot of mines. Actually, that’s a great way to avoid mines. The space represented by a modern software product is hugely more complex than a minefield, so it’s even more of a problem to assume that some small number of “paths”, say, a hundred, thousand, or million, when endlessly repeated, will find every important bug. As many tests as a team of testers can physically perform in a few weeks or months is still not that many tests compared to all the things that can happen to a product in the field.

To get the best coverage we can, we need to explore across many tracks and following the same path works only for things along that particular path. Got it? Let’s move on.

The Roomba is a robotic vacuum cleaner which cleans a space while you are not there. (Or to play frogger or as a cat vehicle.)

So why do I mention the Roomba in a testing post?

This image is a 30 minute exposure photo of a Roomba doing its thing. Notice how it gets near complete coverage? It has explored the space it is operating in and have developed strategies to achieve it’s mission. Note how different techniques are shown; spirals, loops, selective boundaries.

Now think about how you vacuum. (Or would if you did.) Typically you plug the vacuum into the same plug and take the same path through the room.

What lessons might be learned here?

  • ‘Random’ exploration is a good way to increase your coverage and mitigate a lot of the minefield’s challenge
  • Sometimes doing things by hand is faster than automating it. It is a small room and took 30m; it would take under a minute to vacuum that room by hand.
  • This person’s Roomba was modified after it stopped working properly. Your test scripts would be similarly repurposed once their usefulness is expired.