Like many users of Julia, I’m an engineer who mostly uses it to write one-off
scripts and do ad-hoc calculations. But I’ve also started to try to wrap up
some of my more commonly-used functionality into packages for re-use and finding
out: I have no idea how to write proper tests.
The two big questions I can’t seem to figure out are:
- How big of pieces of functionality count as a unit and should have tests
written for them?
- How do you structure a package so that it’s easily testable? I find this
especially difficult since some of the packages I’m writing wrap
functionality from other sources, and I don’t really want to test that the
external dependency is working as expected nor require installation of the
external dependency for execution of tests.
Any advice? Or maybe a good tutorial on testing that’s language-agnostic enough
to be applicable to Julia?