Today, TDD is all the rage, and an increasing number of software stores are turning into flexible, scrum, etc. I certainly see the benefits of automated testing, but I also see TDD as contrary to some principles of good object-oriented design.
TDD requires you to insert seams in your code that display implementation details through an interface. Injection injection or the injection of co-authors violate the principle of information hiding. If your class uses co-author classes, then building these co-authors should be internal to the class and not displayed through the constructor or interface.
I have not seen any literature on the conflicts between writing testable code and at the same time adhering to the principles of encapsulation, simplicity and information hiding. Have these problems been resolved in any standard way?
source
share