watch this  

the official mrchucho blog

Testing Revelation

Posted 2005 Oct 11

I’ll admit it: I’ve come late to the unit-testing party. I finally broke down and wrote a unit test because I had a section of code where the logic seemed fragile and liable to break with the more business logic I applied to it.

Once I realized how easy (and rewarding) unit testing was, I was immediately hooked. I refactored some code and setup unit tests (these things, by the way, go hand-in-hand) and never looked back.

However, it wasn’t until later that I had my revelation: unit testing isn’t about testing; it’s about development. Now I write a test before I write my code. I get two things from this: one, I really have to think about what I’m doing and what I mean. Two, I get immediate feedback: this code works. I don’t have to wait until runtime (or walk through the whole app) to find out if my code does what I want.

Like I said, I’m late to the party, but I’m oh-so-glad to be here.

Responses to "Testing Revelation"

No responses yet.

Comments are now closed.
atom rss