I’ve been offically bitten by the “testing bug”. Meaning, I’m sold on unit testing. I’m always a johnny come lately when it comes to development tools and processes. Usually it’s a real pain to switch tools or add something to my development process.
So I’ve been hearing about this thing called “unit testing” for a while. “Unit tests will change your life!”…”Unit testing is the way to go Joe!”…blah blah. You mean I have to write more code?
A resounding YES I WRITE MORE CODE! I write better code and I write alot more of it. That’s because I can continually apply my unit tests as I’m developing the code. Immediately my tests tell me if the code I’m writing is breaking code elsewhere or simply not working as expected. If I break something I can fix it there while the code is fresh in my brain, rather than later after I’ve made ten other changes.
Now I can focus on writing new code. More “confident” code. The confidence boost alone is worth it. I can write code confident that any changes I’ve made are not breaking the rest of my application.
Unit testing is not going to squash every bug and catch every error. It’s still up to me to write the tests and tell the computer what the results should be, but it will eliminate a good portion of the bugs and errors not caught by the compiler.
Like everyone else who’s been bitten by the testing bug, I can’t believe I never used them before.
For the record I’m writing Coldfusion code and using CFUnit to unit test my templates and CFCs
An information technology professional with twenty two year's experience in systems administration, computer programming, requirements gathering, customer service, and technical support.