I was wondering how I could improve tests for certain packages of mine, let’s take Makie as an example. Makie turns input data to output images but only testing reference images is not satisfactory. We have lots of internal functions that are worth testing, however often it’s reasonably annoying to create the input data they need, as those are usually prepared by pipeline functions further upstream. And we don’t want to copy pipeline implementation into the tests, because that’s a source for errors.
So my question is, if I have functions f, g, h which call each other, but h returns to g and g to f, and the output of f is not of interest. How can I test the output of h given some input for f? Like temporarily overwriting h with a special version that I can grab the output of.