We Write testable code to make the external dependencies injectable via dependcy injection and faking/mocking them while unit testing. But what if: 1. you have too many dependencies and you can't take put like 6-7 things to inject via constructor. Ofcourse it will look ugly in the code. 2. you have some dependecies that you can't fake. So you wrap the dependency in one of your own interface with implementing the real deal. But this is too much of writing code for getting rid of that thing. 3. You have to test the Legacy code that is Either "Restricted" for refactoring or "Refactoring" Cost you a lot as stakeholders don't want you put that much efforts in it.