Srikanth Sastry

Testability Forces Modularity

๐ŸŒณ Evergreen ยท

Hard-to-test code is a design smell: if a class is hard to test, it is doing too much. Too many input combinations, too many side effects, too many conflated concerns. The cure is extraction. Writing unit tests exerts pressure toward smaller, focused modules because the test demands a unit small enough to exercise in isolation.