Dependency injection is a software design pattern that allows a class to receive dependencies from external sources rather than creating them themselves. This can be useful for testing, as it allows dependencies to be easily replaced with mock objects
We can use it in TDD(Test-driven development)
This is mostly asked interview questions
-