Many folks will tell you, you must write unit tests for your code; they make sure you have no bugs. They really don't do that at all. Nor do I write unit tests because someone tells me I must. I write unit tests for what they do for me. Unit tests are empowering. They actually reduce the amount of work I have to do. Perhaps these are not justifications you have heard before. Let's explore them in a little more detail.
Unit tests give you the freedom and confidence to refactor: I love to refactor, perhaps a little too much, but that's a different topic. Refactoring allows me to experiment with varying styles of code, implementations, and UX. By having unit tests in place, I can be adventurous and confident that I don't unintentionally break anything along the way. They can also give you the courage to try new technologies...