Note: this post was written over a year ago, but languished as a draft. I think the ideas are still important to think about so I tidied it up and posted it. –Doug
In the echo chamber of the internet, a story recently made the rounds about how “…Beards Are Covered In Poop.” Of course this is a very shareable story, it’s easy to grasp from the headline and make a quick judgement about. You can either assume that as one tagline claimed, “Says Science” or that it’s just another wild claim. But few people take the time to read one of these articles (more likely the bearded man whose friends posted it to his social media profiles in an effort to taunt him) and even fewer people take a moment to look behind the proverbial curtain.
Pulling back the curtain
The story that started all the coverage appears to have come from a TV station in New Mexico. The report quotes the diagnostic technician who ran the lab tests on swabs from volunteers beards. There are a few simple problems with the whole story that are completely overlooked by most of the coverage about it. The first problem is that the “study” is simply a reporter looking to boost ratings, not a scientist with a careful hypothesis to test. The second is the “study” doesn’t qualify as a study by any means.
To perform a study like this in a scientific manner, you would need to establish a control group, and test not just beards but also the skin of the beard wearer. You would then have a baseline from which you could determine if what you found on the beard was in face abnormal. Some actual scientific studies suggest that a person with a beard might actually have less bacteria on their skin because of the buffer that the beard provides. The timing of these samples would also need to be considered, as someone who has just taken a shower and washed their face/beard would likely have far less bacteria, where someone who has spent a long day outdoors or just finished eating a meal might provide far different results.
A great example of this comes from the Mythbusters episode where they tried to test how much bacteria was being transferred on a bowl of chips when they were shared among users. They discovered that the chips already had so much bacteria on them coming out of the bag, that it was nearly impossible to measure the transfer of bacteria until they rigorously sterilized the chips. Similar to the chips, without a known point to compare the given data to (a clean shaven face) we actually have no way to say anything concrete except that some bacteria were found.
So what about code then?
Is there poop in your code? Well as we’ve seen, there’s really no way to prove it if you have no idea what poop is. Let’s define poop as code that produces errors. Most of programmers spend plenty of time fixing errors in their code and so tend to believe that their code is fairly poop free. Reality is that code will never be 100% poop free, because it’s impossible to test code under the infinite number of situations it could be used past, present or future.
Can we measure and be certain that our code is mostly poop free? This is where the disciplines of testing come into play. The testing methodologies differ in some key ways, but the outcome of regular use provides essentially the same result. Instead of just guessing or hoping code stays clean, testing provides a framework for constantly evaluating and improving what is known about the code-base. Much like how a baseline is needed to perform any sort of scientific study, code testing creates a way baseline to ensure mostly poop free programs.