This project has moved and is read-only. For the latest updates, please go here.

Testing Special Functions

Feb 15, 2010 at 8:14 PM

I was browsing the unit tests for special functions e.g. for the DiGamma function and noticed that parameterised tests are being used to check that the function is almost equal to some value given a specified argument (the Row attribute of MbUnit is used).  My questions are

  1. What is the source of these "expected function values"?
  2. How do you decide you have tested the functions enough i.e. provided enough argument/function value pairs?

Also any general pointers you could give on testing numerical software (either URLs or book references would be of great help).  Thanks for your time and effort.

Feb 16, 2010 at 12:01 AM

Hi smhillary,

We use an arbitrary precision python library called mpmath to test our special functions. There is (afaik) no guarantee that we have tried enough argument/function value pairs. We try to cover as many special and extreme cases as we can though. I'm not aware of any books or articles on testing numerical software but if you find any, please share on this forum.

Cheers, Jurgen