News for hackers. Stuff that matters.
Re:Dependency injection is not a virtue by swanson on Sunday January 06, 2013 @07:36PM (#5018510)
"Following strict TDD doesn't prevent this"

Actually, following strict TDD does prevent this.

You must see a test fail before you make it pass. It goes "Red -> Green -> Refactor" not just "Green -> Refactor". Even if a valid test case passes on the first time, one should modify the test (or the code) in a known way to cause an expected failure.

Your premise (tests are only as correct as the spec of initial assumptions) is correct, but your supporting example is not.

There are no comments on this comment yet.