From: Steve Litt Date: 2005-12-24T00:50:53+09:00 Subject: Re: unit tests == ugly code? On Friday 23 December 2005 10:13 am, John Wilger wrote: > 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. Hi John, How does coding your tests first affect your enjoyment of coding? If you find out later that your (interface, not implementation) design for a class wasn't exactly right, do you then recode your tests first and then recode your class? SteveT Steve Litt http://www.troubleshooters.com slitt@troubleshooters.com