Stop Designing for Testability (by Eli Lopian)

Eli Lopian from TypeMock™, has an article on CodeProject about the disadvantages of design for testability and how to use TypeMock™ to remove these disadvantages while keep the advantages of unit testing.

I have to say that I agree with Eli: design for testability is BAD. It exposes more that it needs just for the purpose of testing and might increase the number of classes and interfaces that need to be implemented, tested and maintained. It also increases the attack surface of the system being built.

I am a firm believer in code for testability. Using tools like Visual Studio and TypeMock™ you can easily test private members of a class. You can do almost the same you would do in design for testability without exposing what doesn’t need to be exposed and go even further by factoring your code in smaller methods easier to test.