Brian Button has an excellent post about how he defeated “Programmer’s Block” through test driven development (TDD). I’ve had a similar experience many times. Having an empty test class can sometimes be very daunting. What test should I start with, what do I even want this class to do? How can I ensure I design it properly? Who is going to use it? What are they going to want to do that I won’t think of? What classes should I build around this class to make the API as simple as possible?
When I start feeling “programmer block” I find that writing the simplest test I can think of is a good way to get going. It’s amazing that a little green bar can give you the confidence needed to get to the next test, but I’ve found that it often does.