Old Dogs....New tricks.
My dog, Rusty, is getting old, he will be 14 years old next month and we have had him since he was 12 weeks old. He is a terrier cross with all the bad traits of the terrier, but all of the good ones too. He has always been “good” at killing; rats, mice, rabbits have all fallen victim to him over the years. He is now blind in one eye, mainly deaf and gets out of breath after playing for more than about 10 minutes, but he still enjoys life and otherwise is very healthy for his age. Recently, we have had a rabbit visiting our garden every day and Rusty tried a couple of times to catch it, but the rabbit was too quick for an aged dog. After the first couple of failures, Rusty gave up chasing the rabbit. The rabbit was eating my plants and despite putting down animal deterrent chemicals, sharp sticks, cages round valued plants, the **** thing kept eating the plants. It started to become more and more blasé about me, my wife or Rusty coming into the garden when it was there, lolloping off slowly rather than fleeing in panic. Rusty kept eyeing it up, but didn’t chase it. Last night, Rusty got it – the rabbit got too close, was too slow and too complacent. Part of me was delighted to get rid of the pesky thing, part of me was saddened at the death of such a marvellous creature. I got to thinking, however, did Rusty play the game of letting the rabbit get more and more complacent with the thought in his mind that sooner or later he would get it? Or, did he just see the opportunity and go for it? He is an intelligent dog. Yes, I know everyone thinks their dog/child/pet is the best/most intelligent/etc. but he really is intelligent, so maybe he did play the patient, long term game.
What has this got to do with testing? As often happens, my mind turned to the similarity between life and testing. Bug hunting is not just about going full blast as fast as you can hunting down those pesky bugs, sometimes that fails, sometimes we have to play the long term game. If we are suspicious of an area in the system, we may have to be patient, try a different strategy. Intermittent bugs are one area where this strategy is best employed. Patience is key to finding an intermittent bug, determining what are the conditions that cause the bug to appear, trying different strategies, minutely changing some parameters to see what might cause the bug. Finally, to complete the analogy, the bug becomes too complacent at not being found and we are able to catch it and kill it. Strangely, there is delight at finding the pesky thing, but some sadness over the death of such a marvellous creature.
Real life and testing sometimes are too close together! Or maybe I need to get a life and stop thinking about testing….