TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What kind of tests do you write for your side projects?

4 pointsby antholeoleover 3 years ago
I have a hobby side project, which I’m quite close to shipping. I started off going for 90% unit tests, but since I’m hacking alone, it ends up taking a bunch of time to keep the tests up to date.<p>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.<p>By day I work at &lt;insert tech giant here&gt;, and I would never push up code without it being unit tested, so it feels a little painful to ship with only integration tests.<p>Thoughts? For those of you who’ve shipped small projects, what tests did you find had the most benefit?

5 comments

earpwaldover 3 years ago
Unit tests help developers, integration tests help logic.<p>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.<p>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.
lerosover 3 years ago
This applies to my MVPs too:<p>Almost none.<p>I&#x27;ll write unit tests for functions containing complicated logic that I can&#x27;t quickly evaluate correctness. This probably amounts to something like 0.01% test coverage.<p>As a project unfolds, I&#x27;ll write proper tests for things that I&#x27;m terrified of breaking. For example, if I was changing my charging algorithm, I&#x27;d probably put proper test coverage around that segment of my codebase.
simplectoover 3 years ago
My side projects can go months without and update. As such I try to do unit tests for my models, controllers, and middleware.<p>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.
errantmindover 3 years ago
I write tests only for tricky pieces of unsafe code, most of my projects are tested the old fashion way.<p>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.
visoxover 3 years ago
None but eventually integration tests