Im thinking of keeping all the old unit tests, but switching to a full integration E2E testing system. This way, I can just text features as opposed to code paths.
By day I work at Thoughts? For those of you who’ve shipped small projects, what tests did you find had the most benefit?
This can annoy folks, but the straight forward truth is that integration tests cover the unit as well as the whole, so if time is limited, they should 100% be the priority as they bring more value.
That said, I love making sure that my code is well unit tested and I build TDD where I can to make that happen. Im not dismissing the value of unit tests, but when you have to make a choice, for me, Integration tests win.
Almost none.
I'll write unit tests for functions containing complicated logic that I can't quickly evaluate correctness. This probably amounts to something like 0.01% test coverage.
As a project unfolds, I'll write proper tests for things that I'm terrified of breaking. For example, if I was changing my charging algorithm, I'd probably put proper test coverage around that segment of my codebase.
I make sure that stubs exist for functional and end to end tests. That way when I do see bugs come in from sentry I can quickly write tests into the right layer. Usually they are unhandled failures on external requests.
When an error state arises I fail gracefully and move on. The most important part in most my projects is just to keep on chugging.