Tuesday, March 30, 2010

Re: How deep do you test?

Just a quick note to follow up my previous post on how deep do you test. I had mentioned some frustration in our test suite regarding integration style tests with asynchronously loaded data. The old adage rings true:

If your tests are hard to write, you're doing it wrong.

I spent the better part of yesterday refactoring the code dealing with the async data after we found that it could have caused some really sneaky bugs. The code is much cleaner now, and well all agreed it was much easier to understand. Everyone was happy and there was much rejoicing.

One last comment before I sign off - the bugs we prevented would have been incredibly hard to track down, and would have likely only shown up intermittently due to cell network latency. TDD really saved us on this one, since without it, we would have never seen the warning signs and realized how fragile some of the logic really was.

No comments:

Post a Comment