"100% unit tests coverage" isnt enough


"100% unit tests coverage"
Many development teams chase that perfect "100% unit test coverage" metric. But the reality is that unit tests alone don't guarantee that your application will function correctly in production.
Unit tests verify individual components in isolation, but real applications are complex systems where components interact in ways that can't always be predicted.
Popular tools: Vitest, Jest.
For functions testing, I use Vitest.
When am testing UI components, I use Vitest with React Testing Library.
Integration tests are needed to check if different parts of your app work well together. They verify that your components interact correctly with each other, databases, APIs, and other dependencies.
This is what happens when you ignore Integration tests:
Popular tools: Vitest, Jest.
For functions testing, I use Vitest.
When am testing UI components, I use Vitest with React Testing Library.
End-to-end tests simulate a real user experience, navigating through your app and checking if it works as expected. They catch issues that only appear when all systems are connected - including frontend, backend, databases, and third-party services.
This is what happens when you ignore End-to-End tests:
Popular tools for E2E testing: Playwright, Cypress, and Selenium. I use Playwright.
Check this article: how to write end to end tests faster with AI assistance.
Still, you can't anticipate all scenarios, so you can't cover all possible paths with tests. This is where monitoring becomes essential.
You can use tools like Sentry. It will send you a report about the crash once it happens.
The report will include:
PS: For frontend apps, it's often as simple as adding a few lines of code.
Alongside error monitoring, you should use uptime monitoring to check if your app is still accessible as expected.
Once your app or service goes down, you will get notified immediately. I use Uptime Kuma for this.
If you're working with limited resources, in my opinion, prioritize in this order:
Solid testing and error monitoring will save your business reputation and money. Also, it will boost your team's confidence to deliver new releases.
Get notified when we publish new blog posts
Comments