Apr 6, 20253 min read

"100% unit tests coverage" isnt enough

"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 meme

Type of tests

Unit tests

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

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:

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

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:

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.

Beyond Testing: Production Monitoring

Still, you can't anticipate all scenarios, so you can't cover all possible paths with tests. This is where monitoring becomes essential.

Error monitoring

You can use tools like Sentry. It will send you a report about the crash once it happens.

The report will include:

  • Where it happened in the codebase
  • User details
  • Session replay
  • Stack traces
  • Environment information

PS: For frontend apps, it's often as simple as adding a few lines of code.

Uptime monitoring

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.

What if you don't have time to write all of this?

If you're working with limited resources, in my opinion, prioritize in this order:

  1. First, set up error and uptime monitoring - this gives you immediate visibility when issues occur
  2. Start with end-to-end tests for your most critical user journeys
  3. Add integration tests for your core business logic
  4. Fill in with unit tests as you develop new features

Conclusion

Solid testing and error monitoring will save your business reputation and money. Also, it will boost your team's confidence to deliver new releases.

Subscribe to Our Newsletter

Get notified when we publish new blog posts

Comments