Perl testing is all about does a module load, does a perl module execute a method, and so on. My interest in computers from the beginning has been numerical methods, even though I have done lots of other stuff. And while Perl/CPAN wants tests, if I am going to make tests, I want to make tests that show that some numerical method is producing accurate results. And there is little in CPAN that has this orientation.
How should one test an interpolant? Having a piecewise cubic interpolate a constant, linear, quadratic or cubic function should only have roundoff error. Is a sine wave a reasonable measure of interpolation? Just a single period? Does a person try to find the MINIMAX error in interpolation? Or should a person look at the error in integrating some function (like sine(X)) over 1 period? Or does one pick something like the predator-prey problem, and look at finding the minimax error, or integral over a period?
I don't think there is a Runge-Kutta-Fehlberg in CPAN (for a predator-prey), I would have to dust off yet more stuff from when I only did FORTRAN.
Gord -
I don't feel there's quite as much difference between your testing needs and most modules' testing needs. Your tests should demonstrate that your code works "as advertised." The tough question is, "What is your module advertising?"
First, your module will make certain guarantees about what sorts of data it expects and how it responds when the user provides something that doesn't make sense. For example, you probably expect an array of numbers as input. How does your module respond if I send it a hashref? Ideally it should do it's best for as many kinds of input as possible: this is Perl, after all.
But the other thing that you advertise is that the module does Akima interpolation. What does this mean? It means that the interpolation error has certain mathematical or statistical properties. Mathematicians and computer scientists have hopefully worked these out for you already, so your job is to verify, statistically, that your module's numerical error hits those targets. A good computer scientist should have taken floating point rounding into account for "perfect" interpolation, and your module should agree.
For all of this, Test::LectroTest can be very helpful, though an extension that allows statistically insignificant amounts of failure would be better. I would offer to help write such an extension, but I'm swamped lately. Likely other modules in the Stats namespace will useful, too.
Hope this helps!
David
--