TDD (Test Driven Development) for beginners

by percent20 13. June 2007 13:07

I have been wanting to learn TDD for a long time now and finally took the plunge and bought a book over it.  It is “Test Driven Development in Microsoft .NET.” I have only started the book, but already I understand TDD a little more than what I did before and most of that has to do with a few steps it laid out quite simply.  It is basically the process you go through when writing your code.

  1. Write the Test Code

  2. Compile the Test code (It should fail since you haven’t implemented anything yet)

  3. Implement just enough to compile

  4. Run the Test to see it fail

  5. Implement just enough to make it pass

  6. Run test to see it pass

  7. Refactor for clarity and eliminate duplication

  8. Repeat from top

For me I understood this, even though it was till hard to figure out, but what I didn’t “get” that was ok to have happen was step 2 which is in bold. It is ok for your compiled test to not compile.  The great thing about TDD is that it is one of those things you can do in almost any language I mean heck you can do TDD with PHP. PHPunit.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS