- a 7 minute read
Here’s the thing. If your delivery team are not testing product, then they’re exposing your business to some serious risks.
There are a number of types of testing. Here are some of the more important ones.
So what’s the point of all this testing? Simple. It’s an investment in the future stability of your product and company. Failing to test now will probably cause problems later. If you have a problem later, it will definitely cost you more to fix it. If it’s a really bad problem. It can destroy your business, and may land you in prison.
Here’s why you should test, in the form of a story about pies. I love food analogies, because food is easier to understand than code. Oh, and there may be some time-travel.
You’re starting up a pie company. You think you have got the greatest pie recipe known to humanity. You’re going to solve the worlds pie problems with this recipe. It’s the recipe that you grew up with, handed down from your great-grandmother on her death bed. You love this recipe. You love your pie.
You work out all the logistics of pie manufacture. You source organic, fair-trade, free-range ingredients. You find a company that can produce thousands of pies at once. You organise graphic design, marketing, sales and how to deliver your pies to every supermarket in the land. You have solved everything.
Except you forgot to test your pie with your customers. If you had spent one day doing customer testing, you’d have realised that a Salmon & Custard pie was never going to sell. Not one pie. Except perhaps to your great-grandmother, but she’s dead. As is your business.
Thankfully, we can rewind time… As you start your pie business, you open up a market stall and have your chef bake a small batch of pies and give them to passers-by. Salmon and custard does not go down well. But your Chicken & Tarragon and Beef & Horseradish pies go down a treat. Hoorah! You’re now on the road to success!
Now your pies are flying out of your market stall, you need to scale up the business. There’s no way that your chef can hand-bake every single pie, even with a big team. You need to set up a pie factory.
On the advice of an industrial cooking consultant, you purchase the pie-o-matic 3000. A simple-to-use, high-volume, pie-making colossus. You simply add your ingredients to the hoppers at the back, program the recipe into the pie-o-matic, and soon you have pies pouring out. You only have to stop the machine when you change recipes, or add new ingredients.
Unbeknownst to you, one of your ingredient suppliers has accidentally swapped your salt for sugar. It’s unbeknownst, because you never test any of your individual ingredients. You’re just backing the truck up to the pie-o-matic and pouring it in. Things don’t go well for you when a bunch of diabetes sufferers end up in hospital after eating one of your sweet chicken pies.
In another instance, you and your head chef are trying to reduce the amount of salt in your Beef pies. Having rigorously tested the reduced salt version on your market stall, you’re both confident that you can reduce to 1 teaspoon of salt per pie. Unbeknownst to you, as you program the pie-o-matic, someone accidentally keys 11, rather than 1 into the recipe console. Unbeknownst, because no-one is monitoring the salt content. Things don’t go well for you when a bunch of people with high blood-pressure end up in hospital after eating one of your oh-so-salty beef pies.
Thankfully, we can rewind time… as you scale up your pie business, you put some simple automated checks in, to test the fundamentals of your pies. One set simply tests each ingredient, to make sure it is what it should be (a unit test). The other objectively tests pie salinity (functional test).
Every single day, your pie-o-matic makes 1000 pies and your trucks are shipping pies to every supermarket in the land. You have unit tests for ingredients, and functional tests for the finished product. You have a panel of customers that are helping you develop new recipes and the money is rolling in. It’s all so goddamn simple now. Thank baby Jesus for the pie-o-matic.
Your business partner comes into your pie-themed luxury office. She looks worried. She has just had a phone call from an irate customer. You’re casual about it. You tell her not to worry. You’re not worried.
By the end of the day, it’s become a national outcry. You’ve taken personal calls from the Prime Minister, the Queen and Gordon Ramsey. Everyone is complaining about the last batch of pies. As you head down to the factory floor, your heart is in your mouth and your palms are sweating. You grab a boxed pie, from the end of the production line and open it. Horror! The pie is burnt to a crisp on the outside. You check another, and another and another. All the same. You have lost thousands of pounds worth of pies, and the trust of the nation.
Thankfully… you know the drill. Time rewinds, and you’re back at the point where you began to scale up your business. The pie-o-matic is working, but this time you hire a taster (QA) to test a few pies from each batch, to make sure that the overall product is still good.
Your new QA, Bernard, was formerly a British pie-eating champion, and is thrilled to be able to put his skills to good use once more. One day he notices that the pies are looking a little darker than usual, and it turns out the pie-o-matic has developed a timer fault, and is cooking for too long. A simple fix, and the nation is sleeping easy once again, stomachs pleasantly full of your pies.
You are the undisputed KING-OF-PIES, and as such you’re beginning to attract attention from competitors, governments and even the lunatic fringes of pie-society.
One day, unbeknownst to you, all of your pie delivery trucks are simultaneously hijacked. However, your pies were not stolen, but injected with a truth serum that makes anyone that eats a pie reveal all of their innermost secrets.
Given the reliance of the nation on your pies, there is an outcry at the highest levels. Parliament is halted; Television news is put on hold; Estate Agents are forced out of business. ‘#PieGate’ is cited as a reason for the downfall of society as we know it. Your Kingdom is in tatters and the country is broken on the wheel of an invading army of croissant-munchers.
Ohhhh woe is you. If only you could go back… wait… that’s right…
Time rewinds, and you stand once more atop a mountain of pies. This time around however, you choose the right path. You choose the path of righteousness. This time, you do a bit of basic security testing.
The first thing you discover is that your truck drivers habitually leave the back doors unlocked, in order to get the pies delivered that little bit quicker. After some discussion, you decide that a number of ‘LOCK YOUR DOORS’ stickers is the best way to avoid these issues in future. Does it mean that your pie trucks are impervious to all attacks? No, but it stops the really silly ones that result in the Doomsday scenario above.
A silly pie analogy is here to help you make fewer of the mistakes that many companies (including your competitors) are undoubtably making. Stay one step ahead, reduce your risks and avoid pie-mageddon.
When was the last time you tested?
This piece was originally published on Medium.com My view of testing has expanded considerably since I originally wrote this, but the basic principle is still the same.