ahudde / greeks

Sensitivities of Prices of Financial Options and Implied Volatilites
Other
6 stars 3 forks source link

[tests] Increase test coverage #17

Closed lrnv closed 8 months ago

lrnv commented 11 months ago

Thanks a lot for you fix in #15 ! Now we can clearly see that, regarding the length of the code, having a coverage level about 50% is clearly not satisfactory.

It looks like (see e.g. there : https://app.codecov.io/gh/ahudde/greeks/tree/main/R ) that whole files are not covered by tests. Do you happend to know why ? Are you able to provide meaningful test suite for these functions ?

Also, the whole C++ code is untested : https://app.codecov.io/gh/ahudde/greeks/tree/main/src which is scary at least. Why is that ?

lrnv commented 11 months ago

In fact, it looks like this is all the Malliavin stuff that has no tests, alongside the UI. I agree, testing the UI is a little complicated, but at least the Malliavin stuff should be checked thoroughly.

ahudde commented 11 months ago

I will also write test for the Mallavin functions, this will then also test the C++-code. But I cannot follow you with the number, I see a coverage level of 42%.

lrnv commented 11 months ago

I mistyped, I meant about 50%. But 42 is low indeed. No need to get that in the 99%s but having a whole half of the package untested was not possible either. I am looking forward to read those tests !

ahudde commented 8 months ago

Dear @lrnv! Thank you very much for pointing the low test coverage out. It certainly helped me finding some bugs :-). I'm not yet at 99 %, but all files except the shiny app have a coverage above 90%. Does this suffice for now?

lrnv commented 8 months ago

I am glad you found a few bugs, this is always a nice benefit of increasing test coverage :)

If you are confident that the shiny app does no important computation for the correctness of what it displays (that is, it should always use other functions that are well tested and not compute stuff directly itself), then yes we dont really care about testing it.

Very good work, you can close this.

ahudde commented 8 months ago

Thank you very much!