Wednesday, January 24, 2007

Lazy with untested code...

I'm a little backwards... I think most people who get into testing are paranoid about untested code, so they are more careful when they are in the realm of code untested. I on the other hand am so use to testing and so confident in the coverage that I almost never run an application after I make a simple change, just run the tests and go... So, when I happen to refactor something, like change a base class that had an inheriting class that wasn't under test, I've caused crashes and other bugs. Before testing, I was so disciplined in fine tuning my code -- no bugs, no problems -- perfect code (well close to it). Its kinda weird that with testing, my untested code has become so poor....

Testing makes writing the code more difficult cause well, personally I find testing to be a completely different way of thinking, but it makes life after the test is written so much easier. I don't have to worry about a refactor breaking something cause its all tested!

Anyway, the point is this:
1. I should be less lazy when I change things that aren't tested
2. Everything should be tested!
3. If I find something that falls under (1) I should enforce (2)

Anyone else have this problem? Has anyone found that pairing and testing made them a more lazy/less disciplined developer when they code alone and/or without testing?

1 comment:

Sadie said...

Thanks for writing this.