O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dependency Injection

Dependency injection1 has grown from a hand-spun and somewhat obscure application assembly approach to a mainstream and widespread approach. Implemented in the Spring framework (Listing 12-1) and the EJB 3.0 (Listing 12-2) specifications in the Java world, Windsor container in .NET,2 and others in many languages, use of dependency injection and inversion of control frameworks has become commonplace, if not always well understood. The prevalence of the frameworks and the principles behind them yields a high likelihood that we can use this pattern for our testing.

1. Also known as Inversion of Control. See www.martinfowler.com/articles/injection.html for an early unifying treatment on the topic.

2. http://docs.castleproject.org/Windsor.MainPage.ashx ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required