News for hackers. Stuff that matters.
Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @09:12AM (#4899031)
I think dependency injection is designed to mostly solve that problem but with that you want to program in a very specific way (e.g calling the DI framework's factory methods rather than just using "new" and a constructor method).

This makes it more difficult to retrofit to code and is sort of awkward when you are integrating with different bits of code and libraries that don't use DI.

Thus the usefulness of mocking frameworks to "force" a particular class to be a certain implementation for the purposes of testing.

There are no comments on this comment yet.