Breaking dependencies in unit tests

"Would I use classloader magic and bytecode manipulation to set dependencies in production code? No. Would I use reflection to modify private fields in production code? No. Would I refactor to introduce an interface between objects? Yes. Would I refactor an object to get a dependency through its constructor instead of from a global variable? Yes." Nat Pryce

Comments

Popular posts from this blog

STM: F# vs Haskell

Akka.NET Streams vs Hopac vs AsyncSeq

Regular expressions: Rust vs F# vs Scala