3 ms·
Personally I have found that structuring my code so that I am able to write unit tests has been far more useful than any unit tests themselves. For your code to
by eberkund 9y ago
Personally I have found that structuring my code so that I am able to write unit tests has been far more useful than any unit tests themselves. For your code to be testable it requires a certain structure and decoupling of dependencies that was not natural to me at all when I first starting doing projects. Now that I know that I might one day want to write a suite of tests with full coverage, I write my code much differently.
- jtbrown 9y agoI agree — I think testable code is generally just better code because it requires the decoupling of dependencies.