Wednesday, January 23, 2008

TDD Newsgroup - Interesting Threads

I've started to read the TDD newsgroup, which is great, and I thought I'd begin to keep track of threads that I've found useful:

  • Extract Class and TDD - I use refactoring a lot so I often end up with (hidden) extracted class that are only tested because the code that uses the extracted class is tested. This thread covers whether this is appropriate. I partricularly like the Method Use Rule post. Anyway my feeling after reading the thread is if I'm extracting to remove duplication then I should tested the extracted class itself, otherwise leaving the tests I have is a valid use. I'm also thinking that any class that is to be part of the ubiquitous langauge should always have its own tests, so even if you extract a specification and only use it once it needs to be tested in isolation.
  • Refactoring - Covers some of the same ground as the Extract Class and TDD one.
  • Mocking Concrete Objects - What I took away from this is that if you have an inteface, or if you think you can add a meaningful interface, then mock that interface if it suits. If you have a concrete class and don't want to add the interface then use real instances.

Share This - Digg It Save to Stumble It! Kick It DZone

No comments:

Post a Comment