Wednesday, July 8, 2009

Benefit for unit tests

From today on I’m absolutely convinced that unit tests are great.

The last three days I refactored my current project a lot – in fact I added 10 classes, deleted 6 and changed 25. If I would have done that in the past without unit tests, I a) wouldn’t have done that and b) if I really would have done that, it would have probably taken me 2 weeks to realize that my uncontrolled changes aren’t working and I wouldn’t get it to work in a reasonable amount of time.

But with my 250 unit tests, I checked every refactoring-step if my code still does what it has to do. And with that, I was absolutely sure about my changes. So, thank you, unit tests!

No comments:

Post a Comment