Recommendation: "Writing Testable Code"

17 April 2011

A few folks at Google have put to­gether a very read­able PDF book called Writing Testable Code. It covers four flaws, and explains, in ad­mirable detail and great clarity, why they are a bad thing, and how to fix them. I don’t usually like ar­ti­cles like this—I find them too vague and non-specific—but this is a bril­liant exception. The four flaws are:

(It’s not just about testable code; it’s about good code in general. Testable code is much easier to reason about than untestable code.)