I am working on a large solution with currently 60 assemblies. There are many assemblies that define common parts for the solution, and then a few entry point assemblies to the system.
TDD is virtually impossible at the moment, as a single line change in the lowest domain layer, forces a rebuild of nearly the entire solution, as the test assembly references various layers of the solution.
What is best practice, to bring the build time down from its current 75seconds to a more acceptable 5 seconds or so? This will make TDD feasible again.
When doing unit tests, some classes require mocks defined by interfaces from other assemblies, and as such have to be referenced in the test assembly. So having a single reference to the other assemblies is not always possible, except at the lowest level of the solution.
IMHO the problem lies here: "as the test assembly references various layers of the solution."
You should have one test assembly per assembly you want to test.
When you still reference many assemblies in each of your test assemblies, you have a different problem: You are creating integration tests. That's not what you want to do in TDD.
In addition to the update to your question:
Normally, you would define the interfaces in another assembly than the implementation. So a change to the implementation of a low level class should have no impact on the higher level classes that use those interfaces...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With