Test-Driven Development

Bookmark and Share

We are all guilty of it. We are eager to code, so we turn on the laptop and let the logic flow from our brain right through our hands and onto the keyboard.  Before you know it, you have blasted through 1000 lines of code, a rack of red bull and 8 Tylenol.

 

Unfortunately, this is all for not — your client calls the next morning to clarify a few of his thoughts and you need to trash 3/4 of the code you wrote.

 

This problem could have been circumvented by using test-driven development.  The concept is simple: Nail down the business requirements, create a test to verify each business requirement, and here’s the interesting part – now you code.  But that’s not all.  You code only enough to pass the first test.  Once this is complete, you move on and write enough code to pass the second test, and so on and so forth.

 

It sounds like developing in reverse, but it will force you to do three things:

·Get the business requirements in stone (maybe in a perfect world).

·Test your code.

·Code efficiently.  You have only enough code to satisfy your requirements.
    (no coding tangents)

 

It takes practice and a little dedication, but it is all worth it when you become a better developer and you develop only the code that you will need.

Leave a Reply

Security Code:

129 Web Design · PO Box 18207 · Portland, Maine 04112