I’m starting a strong push to institute Unit Testing in a relatively new project; I figure it will be easier to really get into the habits in a new project from the start, rather than trying to steer some of our ancient existing projects in that direction right away. But I’ve hit a snag… where should I keep the test classes?
We’ve been using Subversion to manage our project files since shortly after I started here… getting us into source control was one of my first imperatives. So our code is laid out nicely in folders:
In the src folder, I have things organized in packages like
So where do I put the test cases? I could put them in a test package at the root of the project:
But what I’m really leaning toward is mirroring the main folder structure of the package in a test package in the root of the repository, at the same level as the src folder:
My thinking is that the classes in the test package would not get deployed with my actual project code, so they shouldn’t be in the real source package tree. But I’m still not sure.