[gambit-list] Proposed patch

Bradley Lucier lucier at math.purdue.edu
Fri Dec 13 17:28:55 EST 2013

On 12/11/2013 11:39 AM, Marc Feeley wrote:
> You previously said that unit testing was new to you, so I'm trying to 
> explain what would be better unit testing. When the only checks are 
> (cos 0) = 1 and (cosh 0) = 1, not much is being verifying about their 
> behavior.

Marc:  The only reason it seems to you that the testing is light is 
because you factored the test differently than I did in my mind.  I 
tested all the branch cuts (which at one point you said were the 
"hardest part"); I tested all the special values; I tested all the 
implementations that are prone to catastrophic cancellation.

So if instead of dividing tests into function-specific files you had 
made three files branch-cuts.scm, special-values.scm, 
catastrophic-cancellation.scm, and put the various tests in the 
associated files, those files would have been complete.

And I think that that's a better way to organize the tests, anyway. It's 
easier to think of all the functions with branch cuts and set up tests 
for them at one time than to think about all the properties that cos 
should satisfy and be reasonably sure that you've tested them in a 
cos.scm file.


More information about the Gambit-list mailing list