eddelbuettel / rquantlib

R interface to the QuantLib library
119 stars 50 forks source link

Unit tests for curve building #33

Closed eddelbuettel closed 5 years ago

eddelbuettel commented 8 years ago

@tleitch, any interest in adding this?

We basically have two hooks:

For 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?

tleitch commented 8 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.

eddelbuettel commented 8 years ago

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.

tleitch commented 8 years ago

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.

eddelbuettel commented 5 years ago

This got taken care of.