This is a question that has plagued me for years.
You start as a solo founder, time is of the essence, you need to push your product out there and start marketing it. Writing tests takes a lot of time and effort, and it is not the most fun activity to do, but if you do not write them in the beginning it may be very difficult to add new features later on without breaking the existing product, as you postpone writing tests, the bigger the amount of job to actually write them, yes this is called technical debt. But debt is not always a bad thing, it buys you time now so that you can pay later when you have something that generates money... I don't know, I see a lot of cons and pros here, so I wanted to ask you guys, what do you think?
I've been working on a new side project recently and I noticed there was a clear point where I decided to start writing tests: when I was implementing a difficult and complex feature that I didn't really understand.
For a lof of application code (general CRUD stuff, authentication etc) its quite easy to test that out manually by clicking around in the UI but when the feature is complicated, has a lot of edge cases and is hard to hold in your head at once I find tests very useful just to lock the feature-set down and make sure that each new code-change doesn't break functionality somewhere else. The tests might not even be useful once that feature is done so it could even be worth removing them after, but just during development I find it helpful.
Another time when I write tests when building a side-project is when there is a bug in a critical part of the user-journey. For example the other day I introduced a bug which prevented new signups - so rather than just fixing the bug, I also wrote a test for new signups. It didnt take too long so I think it was worth it.
In general though I think my approach in side-projects is to only write tests where it actually speeds up development. If the project ever gets traction or users then I go back and add in the proper test-coverage after.
Thanks for your detailed answer.