Such assumptions as directory names match package names, and file names match class names–something which I have always found annoying and problematic and unintuitive.
May I ask why do you find those unintuitive?
BTW, in Scala (at difference than in Java) you do not have to follow those.
I find them very intuitive most of the time, but I sometimes use a different filename if I believe it makes sense (usually because there are many classes / tratis / objects in the same file)
About the tests part.
I also do not have any problems with them being on different source folders.
And since usually tests classes are in the same package of their main classes, matching them is quite easy for me.
Nevertheless, I would like to put in the table two alternatives I have heard.
Having the tests on a different file but in the same folder as the main files, but with a different extension which allows the compiler or packager to exclude them from the generated artifacts.
Having the tests as methods / functions in the same file.
But the language has a
test reserved word which allows the compiler or packager to remove all those functions when building.
It may be interesting to work with those two alternatives for a while. But my first impression is that those would feel very coupled.
For example, sometimes you need custom logic for your tests, or you want to share a couple of stubs into many tests.