开发者

How to better organize several projects in one solution and their respective unit/integration tests?

I am doing an AI project that currently had the following namespace/package structure:

How to better organize several projects in one solution and their respective unit/integration tests?

My ideia is to have some Unit/Integration tests for each one of the modules (probably not for all of them. Startup probably won't be tested).

Each one of these "main" packages is in a different physical file. I'd like to know what you think would be better:

  • Having for each physical file X.dll a X.Tests.dll
  • Having a Tests physical file that has the whole lot o开发者_运维知识库f tests (doesn't seem like a good idea).
  • Incorporating Breakthrough's tests in Breakthrough.dll, AI.GeneticAlgorithms in AI.GeneticAlgorithms.dll, etc. I kind of like this solution, as then I won't have my Visual Studio solution explorer cluttered with the the whole set of Test projects.

Thanks!


I would have one Test.dll for each .dll. It's the way I'm used to work, and I think it's a good method. You now where what is tested.

As Liam already pointed out, the implementation and the tests shouldn't be in the same dll. It increases the size of the delivered dll unnecessarily and you have to deliver all the dependencies of the tests (e. g. unit testing framework, mocking etc.)


Personally, I would have one project/assembly for startup, one for tests, and one for everything else.

Build time increases significantly with multiple projects, so the less projects the better. Unless of course you need to be able to deploy the different packages separately.

Tests are generally not included in the project they are testing because it requires the assembly to take a dependency on any testing frameworks you are using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜