From: Nathaniel Talbott Date: 2001-03-23T08:45:59+09:00 Subject: [ruby-talk:13103] Re: [ANN] Lapidary 0.2.0 william l kleb wrote: > Nathaniel Talbott wrote: > > > > There's more info on all of this at http://lapidary.sourceforge.net/docs/ > > [...] If you have any further questions/comments [..], please, let me know. > > in the docs introduction you write: > > > [..] One of the keys to good unit testing, though, is not just writing > > tests, but having tests. What's the difference? Well, if you just write > > a test and throw it away, you have no guarantee that something won't > > change later which breaks your code. If, on the other hand, you have tests > > (obviously you have to write them first), and run them as often as possible, > > you slowly build up a wall of things that cannot break without you > > immediately knowing about it. This is when unit testing hits its peak > > usefulness. > > Recently, in a thread entitled "IT World Interview with > Robert C. Martin" > crossposted to news:comp.object and > news:comp.software.extreme-programming > Martin offers a subtly, but IMHO *substantially*, different version of > the "peak usefulness" of unit tests: test-first programming. > Martin wrote: > with emphasis on "you never write any production code unless it is to > make a failing test case pass." You'll get no argument from me about test-first programming; it's what I do every day. Indeed, Lapidary itself was written test-first. However, even test-first programming is dependent on some type of framework for persistently _having_ tests as opposed to just _writing_ tests, because it assumes you can run the tests just as easily after you add functionality as before; otherwise, how would you know you were done? From that, it seems that having tests _is_ the peak of useful unit testing, whereas test-first programming is the peak of good development. Do you agree? Perhaps I need to clarify what I wrote, though, since I'm in love with test-first programming and I don't want to even give the impression that I'm contradicting it :-) Nathaniel <:((>< + - - + - - | RoleModel Software, Inc. & | EQUIP VI | The XP Software Studio(TM) |