As I’ve been working through some of the Base, Core and Julia packages, I’ve noted that the src-test mapping/layout conventions (or lack of), more often than not, increase the burden of exploring Julia and most Julia packages.
One way to discover Julia best practices and understand what ‘works’ is to look at test cases for a method/function/type. So this burden is particularly high for users new to Julia, but experienced in other languages or domains where TDD/BDD is common.
While seemingly trivial this ambiguity/confusion can elevate the level of frustration a first-time user experiences.
Given that an old-hand at Julia will often be a first time user of Package X, this frustration will not diminish with experience. Or will… only if I restrict myself to a subset of packages.
The Style-Guide section is silent on testing conventions, apart from recommending use of
:< for testing types.
One convention that makes it trivial to discover the tests related to some code is:
For the source file location
the convention is: tests are in location
A happy side effect is, apart from aiding humans, such a convention also aids tooling:
- when src file
- rerun the test file
- Has using such a src-test mapping convention been rejected? Or is there some other src-test mapping convention I’m unaware of?
- If there is not a community wide consensus: Is there a convention used by Base and Core packages? Anywhere this is articulated for Base and Core packages?
This post relates to the mental load of a new user in the context of an IDE. the context here is once in your IDE (browsing Github) how do you efficiently get to view the tests related to the definition(s) in a source file.