One of the things I've been thinking is awkward in the Test Driven Development process was the step where you write a test that for a method that doesn't yet exist. If you follow the TDD process as laid out by James Newkirk, you're supposed to write your test case, code as if the method exists, then compile. Of course your code won't compile, since you haven't yet implemented the method. This is your “GO“ ticket for actually implementing the method.
This just seems broken, mainly because I have to use my compiler, not NUnit as a part of my TDD process. Compiling is slow, especially compared with running a test. And compiling when I know it's going to break seems like a waste of time. TDD has reduced the number of times I have to compile in a day, and I want to keep it that way.
But, if you've used ReSharper, it offers a great feature that eliminates this compile step. This is really cool, and it actually makes TDD much easier. Here's how it goes. Write your test for your method (the one that doesn't exist yet). ReSharper will give you an option to implement this method. Choose this option.
ReSharper will open the code file and add the method, using the types from your calling code. It even raises the System.NotImplemented exception for you!

This is cool stuff, and gets rid of this awkward step!
-Brendan
Posted
Fri, Oct 22 2004 8:42 AM
by
Brendan Tompkins