O'Reilly logo
  • Evan Zhang thinks this is interesting:

Testable code is code that is easy to test. Bet you didn’t see that coming! But what makes code easy to test? In general, the features that make code easy to test are the same ones that make it easy to maintain, and more understandable: there’s less of it, and it’s less complex code, fully commented, and loosely coupled. These features and more make code “testable.” By exploiting testability features and using tools focused on testing, you make your code more and more testable.

From

Cover of Testable JavaScript

Note

Testable code rules: sample code, fully commented, and loosely coupled.