DI & IoC are not about testing!

time to read 1 min | 110 words

Dependency Injection & Inversion of Control Containers are not about testing!

I hear this a lot recently. Dave Laribee mentioned that in the Hanselminutes podcast, The creators of Guise seems to think that this is the main concern (01:30 in the video).

Oh, those techniques help, obviously. But it is not about unit testing.

For me, it is like saying that the main purpose interfaces is to enable easier testing.

DI & IoC are about decoupling, better flexibility, having a central place to go to and increasing the maintainability of out applications. Testing is important, but that is not the first and foremost reason.