I have been having a hard sell of “testability is a good thing” at my work. I feel that unit testing leads to testability leads to good OO. The dynamic mocking application TypeMock.NET has not helped: nor has the article Stop Designing for Testability. TypeMock is a powerful application but I think that it can be misused to allow poor design with ease of unit testing. The pain that unit testing creates when dealing with a low testability test subject is experienced close to when the test subject was created. This gives the developer rapid feedback that there is a design issue. The feedback is experience while the developer is still in flow and can make the needed changes with the lest impact to schedule. So unit testing and testability are like an alarm indicating early that there is a design problem. This sounds like a good thing to me, something that I would not want to circumvent or avoid. There are a lot of other characteristics of design that are related to testability. In particular the list below are benefits to testability.
- Fault Tolerance
This list was gathered from Appendix D of Stefan Jungmayr’s thesis Improving testability of object-oriented systems.
If some or all of the list is important to your project then testability will help you get it.7,176 Total Views