TDD: Test Driven Development

Today, for some unknown reason, I felt the urge to study Test Driven Development. I already have other subjects I need to get on with such as algorithms, learning more about the Java language, and refactoring. But there was a nagging sensation that was just begging me to focus on TDD today.

On a side note, a wise man once said, you should strike the iron while it is hot. Which was the final push that made me pick up my TDD books today.

For those who don’t know what TDD is, it is test driven software development. Instead of designing the program upfront, then implementing, then testing – TDD turns the whole process upside down by writing the tests first, implement the code to make the test pass, and then refactoring what you have to the best design you can imagine.

One of the benefits that I like to most to this process is that by working on tests first, you are almost guaranteed to have a test harness to ensure that your code works, and doesn’t regress when you make changes.

Another by-product I particularly like is that the system is never far from a working state. It may not have all the functionality yet… but it works.

Finally, another interesting thing I particularly like is that TDD ensures that you are less likely to over-engineer the program by not implementing things that are unnecessary and instead focusing on the essential functionality of the program. Which is a great benefit for me because being a perfectionist I can quite easily spend many unnecessary hours trying to perfect a minor piece of code.

So here I am working through another book, and another subject, another piece of the puzzle for becoming a well learned (although still a poorly skilled) programmer.

Comments are closed.

Powered by WordPress. Designed by Woo Themes