I'm writing some code for a scientific simulation and I'd really like to use this as an opportunity to get some unit testing practice under my belt. I understand the idea of tests in theory, but I just can't quite see how to apply it to my problem to prove a mathematical result comes out correctly.
For example, a big portion of my algorithm involves doing a numerical convolution to shift and alter a signal; as I only have discrete samples of such a signal, I need to resort to an interpolation procedure before doing any piece of the convolution. Convincing myself the interpolation works is easy enough graphically (plot a known function analytically and plot the interpolation on top of it), but very very difficult numerically (it already depends on the sample rate and interpolation order---both of which can give significant variation in the error of the interpolation).
Of course I can just say "for this signal, sample rate, and interpolation order things agree to a precision of epsilon" but that seems like such a small portion of the test space as to be hardly worth doing. What are some techniques I can use to convince myself that things like interpolation (or matrix inversions, or numerical integrations, or...) work a little bit more generally?