Closed eddelbuettel closed 5 years ago
Yes. I am working on a swap module and will add unit tests (new school) for discount curve, swap, fixed bond, and floating bond that has a real market curve and values that have been reconciled to values from an official source to replace the flat curve in tests/ . many of the options model have unit tests, iit's the fixed income that is missing.
Correct.
I started with the options, but that was way before I switched to using RUnit and there hasn't been a need to translate them just because.
But it is an open field for the Fixed Income stuff. We gotta start somewhere.
PS Forgot the even 'older school'. Way back when we just stuck tests into the \examples{}
section of the .Rd
files. They do get checked during R CMD check
as well but that is even more deprecated. Some very basic tests are hiding in there.
The unit tests/ approach reminds me of the original approach used by the S developers at Bell labs (I used to be the S systems programmer at U Chicago in the 80's).
The fixed income needs non-flat curve testing added and an implementation of unit testing for fixed income instruments. I will do that.
This got taken care of.
@tleitch, any interest in adding this?
We basically have two hooks:
tests/
by adding filesfoo.R
with reference outputfoo.Rout.save
inst/unitTests
which is betterFor the new school approach, some example for dates show how to combine C++ code with R code. I have in the past relied on test input and output from QL itself which may be the way to go.
Thoughts?