DEV Community

Discussion on: TDD, all the time?

Collapse
 
kalpeshbdarji profile image
Kalpesh Darji

I sometimes write code and when I want to test it later I find that testing it can be hard. I end up refactoring to get nice, small methods to test. When I do write the tests upfront I feel like the code ends up much more user-friendly.

Above practice helps you to switch your design mentality naturally to writing small testable methods. That design mentality switch is where I think most of the win comes from when writing automated tests. Ironically, less from the actual tests.