In this fantastic article by Nelson Elhage there are some gems that I share to you:

Avoid running main […] Instead, as soon as I’ve added a feature, if I find myself itching to try it out by hand, I’ve learned to recognize that urge, pause, and step back and write an automated test covering whatever behavior I was about to execute by hand.

If testing your application in code is hard or frustrating, it’s worth the effort to invest in your own testing tooling to make it easier!

Encode every single bug you find as a test, to ensure that you’ll notice if you ever encounter it again.

The last one marries well with the boy scout rule