Thursday, March 06, 2008

Test Driven Development?

I attended Justin Gordon's tutorial on JUnit and Test Driven Development. After sitting through just the first half of the presentation, I definitely see how this could be a useful method to develop. I'm hoping to use it to work on my next work project only because its only me really working on it. I know almost all of the basic requirements already myself because the goal is really to build an internal library to access our data. I just need to hide the guts of the storage and unit conversions and whatnot from the rest of the team. It should be really easy to try out TDD that way. Also the other thing I'm working on is just fixing bugs in our new display/data system. That is the source of the data for the project I mentioned first.

I really like some the guidelines that Justin laid out in the session.
- Make the names describe the requirement under test.
- Test the goal of the code, not the implementation.
- Tests should be for one specific case, not a whole pile of cases.
- Don't try to write a bunch of tests at once and make them all work.
- Do not fix a bug until you have written a test that demonstrates the bug.

I think that last one is huge.

Overall, although I had to leave a little early, I thought Justin did a great job.

No comments: