Seuss: Better Class Responsibilities Through Language-Based Dependency Injection
Unit testing is often made more difficult by the heavy use of classes as name-spaces and the proliferation of static methods to encapsulate configuration code. The authors have analyzed the use of 120 static methods from 96 projects by categorizing them according to their responsibilities. They find that most static methods support a hodgepodge of mixed responsibilities, held together only by their common need to be globally visible. Tight coupling between instances and their classes breaks encapsulation, and, together with the global visibility of static methods, complicates testing.