10 things I learned from writing a lot of unit tests

  1. 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
  2. Most of the issues you see are because of lacking tests beyond coverage, or config stuff.
  3. It is safe to update all packages
  4. I test very little manually
  5. Debuggers aren't a must most of the time.
  6. It is much easier to write clean code when you unit test; and the other way.
  7. If you can't test it, it is probably wrong
  8. It isn't that hard or pain in the ass to get into it if you write clean code
  9. It is way faster in the long run
  10. 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.