Always Think Things Through

Every time I think I have a brilliant idea I stop and think about any possible unforeseen consequences before I continue. Why? Well, I remember back to when I was growing up and had a brilliant idea (I was full of them) and my parents we good enough to let me “experiment” with my ideas. This particular brilliant idea was about me making a chocolate soda…

Chocolate soda seems like such a simple concept, doesn’t it? After all, it’s just chocolate and carbonated water… So I took a small bottle of club soda, took a sip to make space, and then filled the bottle back up with Hershey’s syrup and sealed the cap. What’s the best way to mix liquids in a bottle? I hope you said “shake it”, because that’s exactly what I did. Let’s just say that when I opened the bottle to take a drink the outcome wasn’t quite what I was expecting. A change of clothes and a cleaned up kitchen later, I had learned a valuable lesson; think things through a little more before starting to work on a great idea.

If you stop and think about it, it’s really not all that different from Test Driven Development (TDD). You know what you want the code to do, so you write a few tests, then you write to code to make the tests pass. As you write your code you see a few edge case scenarios, so you write tests for those. Then you work on making all your tests pass. It’s about thinking through all the steps as you go.

Granted, in true TDD fashion, I should have first verified that I could open a bottle of club soda, then taken another bottle and vigorously shake it like I was mixing something in it and open it… Of course, during that test I would have only sprayed club soda everywhere, but that would have avoided the chocolate disaster, right?

At least I wasn’t building a bridge…

From Test Driven Development across Java, JavaScript, and Perl by Aaron Cohen

There’s plenty of options for writing and running tests, so there’s no excuse for not finding an option that works for your project and the programming language(s) involved . The bigger item is making sure that they’re actually written and used. Then your developers are thinking things through and you might actually catch an issue before it goes in to production, even if it takes a while.

I’m not saying that would have saved me from spraying home made chocolate soda all over my parents’ kitchen though, after all, I didn’t know about TDD back then…

Leave a Reply

Your email address will not be published. Required fields are marked *