10 things I learned from writing a lot of unit tests
- When you go for close to 100% test coverage you can with confidence say that it does what you think it does. Even with large and complex systems
- Most of the issues you see are because of lacking tests beyond coverage, or config stuff.
- It is safe to update all packages
- I test very little manually
- Debuggers aren't a must most of the time.
- It is much easier to write clean code when you unit test; and the other way.
- If you can't test it, it is probably wrong
- It isn't that hard or pain in the ass to get into it if you write clean code
- It is way faster in the long run
- If you write tests for what you change and cover all of those files it isn't that hard to get a significant coverage. Even in larger code bases.