On Aug 30, 2006, at 3:48 PM, Morton Goldberg wrote:

> I guess I need to read up on the philosophy behind unit testing.  
> Know any good references?

You know, I've read a couple of books on the subject now and still  
have not found one I just fell in love with.  Hopefully others will  
chime in with some good suggestions.

> Also, I still don't like the idea of creating test objects over and  
> over again, especially for tests that don't use them at all. Maybe  
> my old (and now bad) habits formed over years of working on  
> machines with limited resources are leading me astray, but -- at  
> least for now -- I can't overcome my distaste for such extravagance.

Remember, these are unit tests, not nuclear missile guidance  
systems.  The code is only run when you ask it to run as a tool to  
help you develop your code.

The goal is to make that testing process as painless as possible, not  
to win awards for speed and low memory consumption.

This is also very common in unit testing.  Rails for example reloads  
database fixtures before every single test, whether the test uses  
them or not.  That's a substantially higher commitment than your  
eight DayRange objects.  ;)  (To be fair though, the Rails team has  
had to work hard to get that fixture load time down.  Slow tests are  
bad!)

>> I also don't believe you have the order correct.  Your tests run  
>> as expected on my box with no modification to the method names.  I  
>> haven't gone into the source of Test::Unit to determine why this  
>> is, but it could be that the methods are hashed in which case you  
>> can't count on any order at all.
>
> I'm not sure what you mean by not correct. My results printout  
> speaks for itself, doesn't it?

Oops, I misunderstood them.  My bad.  The situation you described  
*is* the same on my box.  Sorry to spread confusion.

James Edward Gray II