abenci
abenci

Reputation: 8651

Unit Tests re-organization

Normally we work with one Visual Studio solution that contains the product project and the unit testing project.

Our unit testing project is growing fast (2000+ unit tests) and it becomes slow to load/rebuild and difficult to browse. Consider also that - AFAIK - in Visual Studio 2012 test categories are not visible anymore.

We are thinking to split it in multiple unit testing projects:

  1. Would it be possible to load multiple unit test projects in the same Visual Studio solution?
  2. What is the best approach when the number of unit tests grows so much?

Thanks.

Upvotes: 2

Views: 139

Answers (2)

syned
syned

Reputation: 2321

I create unit test project for every assembly. I think you should group your tests by system or component to which they are related. Achieve loose coupling and high cohesion in your tests. Look at this approach Structuring Unit Tests.

Try to use NCrunch to better feedback from tests and avoid to rerun tests.

Upvotes: 1

Claudio Redi
Claudio Redi

Reputation: 68440

Would it be possible to load multiple unit test projects in the same Visual Studio solution?

There is no problem about this, you can have more than one unit test project

What is the best approach when the number of unit tests grows so much?

The first and natural approach is to have one unit test project for each project on your solution. If you have a single project on the solution, maybe that's where you need to start the refactoring.

Upvotes: 3

Related Questions