I am not quite sure if this question is relevant here; maybe it’s too high level.
Say I have an interface Foo which is implemented by two other concrete classes FooProduction and FooTest. The first one is the production code and the other one the test implementation. Now I want to package everything up but I am not sure which is more suitable. Moving the FooTest class in the test package (where I keep all my tests) or keeping Foo, FooProduction and FooTest in the another package, lets say the foo package?
I would say that making sure
FooTestcan never find it’s way onto a production machine would be the highest priority. As such my vote would be for dividing things along theTest/Productionboundary.I don’t know what language you’re actually implementing, but in the Java world, the Maven software management system is extremely popular and generally well-regarded, and it makes extremely strong distinctions between so-called “
main” and “test” code, resource files, and dependencies. Indeed in their documentation they indicate this is a “testing best practice”.As to where to put the interface
Fooand itsFooProductionimplementation, that’s really a question of personal (or site) preference. I like having a package that holds all the domain model objects together for example.