Test Driven Development (TDD) ensure Dependency Injection (DI)?

dependency-injection, tdd

Solution

TDD is a method to design and develop a software.

Dependency injection is a technique to allow selection among multiple implementations of a given dependency interface at run time or at compile time.

While one might argue that these two are independent, doing TDD without DI is possible, but difficult. Therefore, I would say that doing TDD for the medium to large projects does require dependency injection.

Problem

sorry for what might be a poor question but I am a bit confused. Would TDD help ensure DI? or is it the other way around (DI is required for TDD).

Original source