Test-driven development: Write better code in less time by Evan Dorn
"I know I should write some tests, but I can't afford the time. I have to get this feature out the door." That's absolute crap, friends, and if you hear someone say it you should slap them.
Yes, tests provide a measure of code reliability at the apparent cost of extra work. But 'tests' and test-driven development are not the same animal.
TDD (or
BDD) is a process that will deliver not just superior code, but massive accrued time savings over the life of your project. With experience, it will also provide immediate time savings in almost every case: when you're doing it right, it's usually faster to write the tests and the code than just the code.
I'll explain the
difference, and walk through some concrete examples.
I'm a lifetime geek/hacker/engineer/scientist and obsessive crea
...