Home > Work > Test-Driven Development: By Example
1 " If you're happy slamming some code together that more or less works and you're happy never looking at the result again, TDD is not for you. TDD rests on a charmingly naïve geekoid assumption that if you write better code, you'll be more successful. TDD helps you to pay attention to the right issues at the right time so you can make your designs cleaner, you can refine your designs as you learn. "
― Kent Beck , Test-Driven Development: By Example
2 " However, those whose souls are healed by the balm of elegance can find in TDD a way to do well by doing good. TDD is also good for geeks who form emotional attachments to code. One of the great frustrations of my young engineer's life was starting a project with great excitement, then watching the code base decay over time. A year later I wanted nothing more than to dump the now-smelly code and get on to the next project. TDD enables you to gain confidence in the code over time. As tests accumulate (and your testing improves), you gain confidence in the behavior of the system. As you refine the design, more and more changes become possible. My goal is to feel better about a project after a year than I did in the starry-eyed beginning, and TDD helps me achieve this. "
3 " Used Pluggable Adaptor, which we promise not to use again for four months, minimum, because it makes code hard to statically analyze. "
4 " Write tests until fear is transformed into boredom "
5 " Rather than apply minutes of suspect reasoning, we can just ask the computer by making the change and running the tests. "
6 " Are the teeny-tiny steps feeling restrictive? Take bigger steps. Are you feeling a little unsure? Take smaller steps. TDD is a steering process -- a little this way, a little that way. "