From: Rick DeNatale Date: 2007-09-05T06:17:29+09:00 Subject: Re: Embedded vs. Non-embedded Tests On 9/4/07, Trans wrote: > > > On Sep 4, 12:07 pm, "Rick DeNatale" wrote: > > Personally, it just feels right to me to separate the test code from > > the code under test, most test equipment belongs in the garage instead > > of the trunk of the car. > > Interesting analogy. We do put some gages right on the dash. But > that's more like embedding the tests directly into code --eg. rescue > and try clauses. So maybe you're analogy is a good one. I can see some > reasons for doing so, it certainly make it easier to send some one a > test, that they can try against their own implementation, for > instance. But then I start to wonder about API documentation too. > Should that also be separated out into dedicated files? Why tests but > not docs? Well , it probably seems more obvious to most to put the doc with the code (assuming that there is any doc ). Note that we've just now seemed to get tools like dcov. It's long been pretty standard process to have tools which extract doc from code. On the other hand there are some arguments for keeping even these two separate. In "The Psychology of Computer Programming" Gerry Weinberg talked about the trap of "debugging" the comments instead of the code, and advocated tools which would not just extract code commentary but REMOVE it. On the other hand without having the doc with the code and tools like rdoc we'd probably have even less documentation than we do now, just a guess. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/