From: John Wilger Date: 2005-12-24T00:13:54+09:00 Subject: Re: unit tests == ugly code? On 12/22/05, Steve Litt wrote: > I cannot in a million years imagine coding without design. Neither can I -- which is precisely why I never write my classes before my tests. Writing a class is _not_ design; that's called "programming by intention". Figuring out what you need a class to do, and then specifying the API is design. This is (part of) what the tests do. They give you a chance to work with the interface as a _client_ of that interface to see how things fit together _before_ you commit yourself to the implimentaiton. > I've > never coded tests first (I test each class after coding it), but I > can't imagine why writing the tests first would make one not > design. If it did make me not design, I wouldn't code test first -- > I'd make test jigs after. -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland