Why I love TDD
{I don't know if you've noticed, but half of my posts are rants against software doing stupid things :-), this post also started this way, but I decided that I'm too negative.}
Well, I just finished a major refactoring season that would've been impossible without Tests.
I just started writing this software, but already it has several thousands of lines.
I started this project without any design, so I broke so many roles that it's lucky that I'm headed for prison tomorrow, or else I would be there today :-D.
I run FxCop on the project, and it popped several dozens of recommendations, which I know I wouldn't have been able to implement, if I didn't have the tests.
I'd a similar project, about half a year ago, I tested FxCop then, and wanted to do good, but the effort of changing & changing the project was just too much work to do.
Now, with the aid of TDD & ReSharper, the work goes very smoothly, and I'm confident that at the end, I'll have a better code, that does {roughly} the same thing.
If you aren't into TDD yet, try it. The best part isn't when you see that all the tests passed.
The best part is when you make a single inoccent change {such as moving a file from one folder to another} and you suddenly see half your tests bomb, and you just knows that this bug would've slipped to production.
I just came from such a bug, I moved a resource file to another directory, and suddenly I started seeing a lot of failed tests. After a false start {I made a change in the resource fetching code as well}, I finally found it.
P.S:
Why changing the path of a resource also change it's name in the assembly? This is stupid.
Comments
Comment preview