ringbp icon indicating copy to clipboard operation
ringbp copied to clipboard

correctness tests

Open sbfnk opened this issue 9 months ago • 5 comments

Current tests assess that the R code works but not correctness -- I would suggest at the very least to add some snapshot tests so that if any code changes affect model outputs this can be assessed manually.

sbfnk avatar May 07 '25 14:05 sbfnk

There are actually some tests that test correctness (looking at results based on a given seed). But snapshot tests should be more robust.

sbfnk avatar May 07 '25 18:05 sbfnk

I'm a bit wary of the test changes in #98 relaxing the shouldn't-ever-go-extinct case. Perhaps there need to be other parameter tweaks to ensure non-extinction dynamics (more initial cases?), but shifting 0 to 0.2 bugs me.

BREAK-BREAK

any news on re-running the analysis?

pearsonca avatar May 09 '25 10:05 pearsonca

I'm a bit wary of the test changes in #98 relaxing the shouldn't-ever-go-extinct case. Perhaps there need to be other parameter tweaks to ensure non-extinction dynamics (more initial cases?), but shifting 0 to 0.2 bugs me.

It's stochastic so won't any solution here be similarly arbitrary? We can never fully ensure non-extinction dynamics (except by tweaking the seed, but I don't see how that's necessarily better).

sbfnk avatar May 09 '25 11:05 sbfnk

It's stochastic so won't any solution here be similarly arbitrary? We can never fully ensure non-extinction dynamics (except by tweaking the seed, but I don't see how that's necessarily better).

Sure, but 20% seems high. If the shift had been to "< 0.01" and the test was typically yielding 1e-5 extinction, that wouldn't bother me.

pearsonca avatar May 09 '25 12:05 pearsonca

Yes, fair. I guess we could run more simulations but if we don't want to slow down things the easiest thing would be to reduce the dispersion a bit.

sbfnk avatar May 09 '25 13:05 sbfnk

The package testing was improved in PR #160 and addressed the request for snapshot tests.

On the testing of extinction functionality, it's best to merge PR #161 (which changes the extinction functions) before updating those tests.

I'm closing this issues. Feel free to reopen or log any new testing related issues in a new issue.

joshwlambert avatar Nov 17 '25 10:11 joshwlambert