News for hackers. Stuff that matters.
Re:When to refactor code by InclinedPlane on Thursday May 16, 2013 @10:47AM (#5718860)
One advantage of TDD is that encourages your code to be more easily testable. Which tends to encourage you to develop properly modular code. Code that can only be tested indirectly through integration testing (spinning up huge unwieldy hunks of context that are required for the individual sub-component to work properly) is not very modular.

Modular code tends to have fewer dependencies and tends to produce fewer side effects. All of these things make for code which is generally easier to maintain and modify, easier to understand, easier to debug, and easier to reuse. All of which tend to lead to higher code quality naturally.

A high level of unit test coverage also gives you other benefits, of course, but I thought I'd highlight these side benefits because they are perhaps the most important.

There are no comments on this comment yet.