Construction injection is another method of Dependency injection. Purpose of such approach is to make your application loose coupling and run components independently. In this method Dependencies of the classes (The resources a class needs to run desired functionality) are provided through a constructor.
There are 2 other methods of Dependency injection, which are
1- Property Injection
2- Method Injection
We will discuss other approaches in another article.
Construction Injection and its importance in TDD for CI/CD could not be ignored. This approach has several advantages like to achieve separation of concerns, Inversion Of Control (IOC), which is interface based programming and most important of all TDD which is Test driven development. TDD is important as you can test whole application with just a click. TDD application is further helpful when you want to go for Continuous integration and Continuous Deployment which is CI/CD.
So in short for a big application product we consider adopting approach on very early stage so in longer run it becomes system instead of nightmare.