Feed Icon  

Contact

  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics

Tags

Open Source Projects

Archives

Ads

Getting it

Posted in General | ASP.Net/Web Services | Test-Driven Dev at Monday, December 06, 2004 4:09 AM Pacific Standard Time

Thanks to Brian Button, I am starting to get test driven development (TDD). TDD is a simple concept which is probably why it took so long for me to get it. I thought I understood it after reading through TTD in .Net. However, I think I only understood the concept of TDD, not how to actually implement it. For some reason my idea of TDD just didn't work very well in practice and I usually ended up neglecting my tests when I wrote code. However, thanks to Brian I feel that I'm getting it.

A few of the things that helped me get it:

As a sidenote, when I'm just starting off, I'll frequently put the test class and the application class in the same file for a while, until the classes get too big, at which time I'll extract them to their own files and deal with switching between buffers.

Ok so this is no big deal in theory, but in practice this made a big difference for me. I'm the type of developer who will not only create a seperate file for every class, I want to create a seperate project for my tests. KISS. I took this advice and suddenly getting started writing tests wasn't such a chore.

I know the implementation is really, really simple at this point, but I trust that I'll learn more very soon, and I'll be able to tell where to take it then.

This was the big learning point for me. I like to create complex implementations which tend to be hard to test. However, I learned that one of the most important aspects of TDD (at least for me) is to not even worry about the implementation. The implementation isn't the focus, it is that your code passes the tests (including the customer tests). Its that simple. This was hard for me because I like to come up with complex implementations and then I end up getting bogged down trying to figure out how to test them. The reality is I should come up with the tests first and then do the simpliest thing that works.

I think I'm starting to get it. :)

Read the whole series:

Enjoy!

Comments are closed.