Can your code pass the smell test?
My toddler son is sometimes an extremely finicky eater, well, most of the time. His eating habits could put some birds to shame but he seems to always eat enough of the foods and is in good health. As the father, I want him to learn the same appreciation that I have for all types of foods but as a toddler, he just wants chicken nuggets and french fries. When he was younger and just starting to eat solid foods, the kid would eat anything and voraciously devour the food. I remember the first night that we gave him clams… yes, good ol’ North Carolina little necks fresh from the coast. He probably ate as many as I did. Now, he is older and a little more particular on what lands on his plate. My wife and I will add something a little more diverse to his plate and have gotten into the habit now trying to give him one thing at a time. The looks that he gives when we introduce something new to his plate. Seriously, the kid has some amazingly expressive eyebrows. Recently, he has included a new step to this ritual of food inspection… the smell test. If he doesn’t like how it smells, it simply will not go past that point. In his mind, bad smell equates to something bad for him or that he won’t like…. now back to the Chicken Nuggets.
A few days ago, I was explaining to a junior developer why he needed to include tests with every feature branch that he creates. He explained that he just would run through his notebook of steps and confirm the responses and wasn’t this good enough. Remember, it isn’t always about what you add today but what you add tomorrow or added yesterday. Protect your code sanctity by including unit and integration tests into your code. I have actually gotten into the habit of testing the entire list of tests before committing my branch. Why? Because, I know with a high degree of confidence that my code will work right the first time that someone pulls it.
The test suite doesn’t matter but the tests do matter. Eventually, I will add some material around different testing suites depending on which language you are using. I will also dive into a tutorial on how to do Test Driven Development for all of your projects. Save your sanity and invest in a testing strategy. Join me tomorrow as I talk about Style and Consistency habits in writing code.