From: Patrick Gundlach Date: 2005-12-22T10:07:49+09:00 Subject: Re: unit tests == ugly code? > I've found that when I write the tests first, and then write the code, > I'm not very concerned about what the code looks like. When the code > passes the test, I drink a beer and party, then move on to the next > test. How many tests/day do 'you' pass? ;-) > In practice, this means that I'm using a lot of ugly regex's, poorly > named variables, and so on. I'd be more concerned about the > readability of the code if there wasn't unit tests behind it. I'm > generally in a rush to finish whatever I'm doing, and figure that > since I have a bunch of tests, refactoring stuff later won't be a big > deal. > > Anyone else out there like me? Pretty much the opposite. When I do TDD, I am very careful about the code I write. I work hard that my tests look good (so that I can see what I meant when writing it) and robust. And I program so I can test (less monolithic etc.). I should do *much* more TDD. Patrick