back

by jader201·12y ago·view on hn ↗
I think this is partially true. But I think it goes beyond breaking your code down into smaller modules.

To me, the biggest difference between testable and non-testable code is decoupling code from dependencies through interfaces (vs. class coupling), and then being able to mock those dependencies.

Even if your code is in small, independent chunks, it's still not testable if it has tight class coupling.