If method A()
calls static method B()
, this is bad because the two are tightly coupled, correct?
But if, instead of calling B()
, A()
called a non-static method C()
of some concrete class, this would be equally bad for testing, correct? Because now A()
is coupled to the concrete class that owns C()
.
The only good scenario happens when interfaces (i.e., dependency injection) are used, and A()
calls the interface's method.
Do I have it right? Are there any other reasons static methods are bad for testing?