Yu-Group / simChef

An R package to facilitate PCS simulation studies.
https://yu-group.github.io/simChef/
GNU General Public License v3.0
20 stars 0 forks source link

`testthat` integration #138

Closed PhilBoileau closed 1 year ago

PhilBoileau commented 1 year ago

Have you considered integrating a unit testing framework with simChef? Is is even possible? If so, unit tests could add a degree of robustness. I can imagine this feature being useful when, for example, submitting supporting simulation studies in statistical analysis plans.

jpdunc23 commented 1 year ago

If I understand correctly, I think this is more or less already possible with existing tools. For example, users can (and should) write unit tests, e.g. using testthat, to check the validity of their dgp_funs, method_funs, helpers, etc. One thing we want to do is expand the docs to include some suggestions for how to organize a project that uses simChef, so that would include unit testing as well.

But I think I'm not fully understanding what you have in mind. Can you say more?

PhilBoileau commented 1 year ago

No that's exactly what I meant. I should have noted that this isn't a true issue --- I'm just hoping to start a conversation.

Discussing unit and integration testing in those docs would be incredibly helpful. You've probably thought about this already, but users might also appreciate the ability to (optionally) automatically run these tests when calling run_experiment(). These tests could run before the actual simulations begin, with warnings and errors halting the experiment. A summary of the tests might be reported in the summary notebook produced by create_rmd().

jpdunc23 commented 1 year ago

You've probably thought about this already, but users might also appreciate the ability to (optionally) automatically run these tests when calling run_experiment(). These tests could run before the actual simulations begin, with warnings and errors halting the experiment. A summary of the tests might be reported in the summary notebook produced by create_rmd().

I hadn't thought about this, but I think it's an interesting idea. Some formal integration of unit testing also aligns well with our goal of providing tools that encourage high-quality simulation study design. Is this something you'd be interested in helping to implement?

PhilBoileau commented 1 year ago

Certainly, I’d be happy to work on this.