Over the weekend I decided to try my hand at brewing beer. For those who know me, I have a chronic case of curiosity. Here’s what usually happens. I see something interesting and my brain starts to ask, “I wonder how that works?”, and before you know it, I’m down a rabbit hole. Well, this is no different. I was recently on vacation and visited several distilleries, where I started to wonder how the distilling process works. Once I got back home, my curiosity overcame me and I bought a kit to start home brewing. What’s interesting is how something unrelated that we are learning can show us perspective in the process.
What I enjoyed was the checklist of all the things I needed to do. I unpacked the box of bottles, carbonated drops, yeast, and extract. Step one, clean EVERYTHING. When I say everything, it says to clean EVERYTHING! I understand that cleaning would be the first step, but I was surprised at how far it told me to take it. The instructions even had me put the can opener for the extract into the cleaning solution.
As I thought about it, I started to think about what wisdom could I gain from making beer.
Just as I needed to put my environment into a clean and sterile state, testing software is similar. Brewing beer can quickly be ruined by tiny microorganisms that are invisible to the eye. It will warp and tarnish the beer as extra bacteria or dust come in contact with the yeast and sugars. When software is not in a clean and known state, you can’t trust the outcome of your tests. Often in the past, I’ve had a test fail due to bad data in an environment, or sometimes the previous test didn’t properly clean up after itself. There are any number of potential risks that can cause your test to be unreliable such as someone accidentally dropping a table in QA, which unfortunately is a true story.
Each test that you perform, whether it is manual or automated, should start from a place where everything is clean. Where there’s no leftover data, no drivers hanging around, just clean and sterile. If we have a CREATE operation, we will attempt to create a DELETE operation at the same time. While the delete operation is not yet needed for the business, the added value for cleaning up the tests has been amazing and I would highly recommend it.
As you test and bring the risk assessment to your organization, think of ways to make the tests more reliable. Start by putting the application under test into a known state and leaving the environment cleaner than you found it.
Additional Reading:
https://www.homebrewersassociation.org/how-to-brew/brewing-best-beer-malt-extract/
Greg article Andrew. I really like the way you were able to connect your experimentation with making beer to good testing practices.
Keep up the awesome work!