Skip to main content

Scatter guns and muskets.

Many, Many years ago I worked at a startup called (a European online travel company, back when a travel company didn't have to be online). For a while, I worked in what would now be described as a 'DevOps' team. A group of technical people with both programming and operational skills.

I was in a hybrid development/operations role, where I spent my time investigating and remedying production issues using my development, investigative and still nascent testing skills. It was a hectic job working long hours away from home. Finding myself overloaded with work, I quickly learned to be a little ruthless with my time when trying to figure out what was broken and what needed to be fixed.

One skill I picked up, was being able to distinguish whether I was researching a bug or trying to find a new bug. When researching, I would be changing one thing or removing something (etc) and seeing if that made the issue better or worse. When looking for bugs, I'd be casting the net wide, trying to catch as many issues as I could.

Nowadays, as a full-time tester, I use both skills every day. When I think I've uncovered a curious result or behaviour I switch to investigating mode to zoom in on prevalence, scope and causes etc. A good programmer will also usually have very good investigative skills which they put into practice when debugging and researching anomalies. 

Some people attempt to formalise what we (programmers, testers etc) do, by copying what people appear to be doing and putting that into a script. For example, some teams often take the 'change/try one thing' approach from research & investigation and try to use that -alone- for testing. They use a (BDD, Excel, Notepad etc) script that checks a calculation by calling the feature with example parameters, and checking the answer is correct. Great, Job done, green tick, the feature works, move on. (Ok, maybe not.)

Step 1: How might we improve on that?

That might be useful. But for just a couple more lines of code (basically just a for loop) you could check 100,000 parameters. This scattergun of data is much more likely to catch a bug. Why? Well, for example, there are usually rounding issues, hidden boundaries etc. From my experience there usually are issues, that won't come to light with just a token couple of example musket shots through the logic.

Picture of a Flintlock Musket called Brown Bess
Bess fired a lead bullet 1.9 cm in diameter, but could only fire every 20 seconds.

Step 2: Change of approach

We can use these same techniques and tools when testing in real time. We don't need to have a fully automated solution straight away. This gives us the ability to also find these issues up front, as we test. This isn't so much a technology change but rather, a change of mindset.

We can stop thinking of 'the tests' as being an immovable, unchangeable detector of 'goodness' (or not bad-ness for things we have checked) and instead think of them as a handy tool that I can grab anytime I need to dig deeper, get a clearer picture of whats going on. The 'tests' become something you use, a toolset, rather than something you build.

You will soon find your code is more generalised, more configurable and helps you find bugs - quicker.


Popular posts from this blog

The gamification of Software Testing

A while back, I sat in on a planning meeting. Many planning meetings slide awkwardly into a sort of ad-hoc technical analysis discussion, and this was no exception. With a little prompting, the team started to draw up what they wanted to build on a whiteboard.

The picture spoke its thousand words, and I could feel that the team now understood what needed to be done. The right questions were being asked, and initial development guesstimates were approaching common sense levels.

The discussion came around to testing, skipping over how they might test the feature, the team focused immediately on how long testing would take.

When probed as to how the testing would be performed? How we might find out what the team did wrong? Confused faces stared back at me. During our ensuing chat, I realised that they had been using BDD scenarios [only] as a metric of what testing needs to be done and when they are ready to ship. (Now I knew why I was hired to help)

There is nothing wrong with checking t…

Why you might need testers

I remember teaching my son to ride his bike. No, Strike that, Helping him to learn to ride his bike. It’s that way round – if we are honest – he was changing his brain so it could adapt to the mechanism and behaviour of the bike. I was just holding the bike, pushing and showering him with praise and tips.

If he fell, I didn’t and couldn’t change the way he was riding the bike. I suggested things, rubbed his sore knee and pointed out that he had just cycled more in that last attempt – than he had ever managed before - Son this is working, you’re getting it.

I had help of course, Gravity being one. When he lost balance, it hurt. Not a lot, but enough for his brain to get the feedback it needed to rewire a few neurons. If the mistakes were subtler, advice might help – try going faster – that will make the bike less wobbly. The excitement of going faster and better helped rewire a few more neurons.

When we have this sort of immediate feedback we learn quicker, we improve our game. When the f…

Thank you for finding the bug I missed.

Thank you to the colleague/customer/product owner, who found the bug I missed. That oversight, was (at least in part) my mistake. I've been thinking about what happened and what that means to me and my team.

I'm happy you told me about the issue you found, because you...

1) Opened my eyes to a situation I'd never have thought to investigate.

2) Gave me another item for my checklist of things to check in future.

3) Made me remember, that we are never done testing.

4) Are never sure if the application 'works' well enough.

5) Reminded me to explore more and build less.

6) To request that we may wish to assign more time to finding these issues.

7) Let me experience the hindsight bias, so that the edge-case now seems obvious!