Dependency injection

noun phrase

A design pattern where objects receive their dependencies from an external source rather than creating them internally. Improves testability and decoupling.

"By using dependency injection, we can swap the real database for a test double in unit tests without changing the service code."