Course contentsShow
← Software Engineering
Lesson 411 of 1,93312. Testing FundamentalsFree lesson

Test Distribution Guidelines

Learning practical ratios: roughly 70% unit, 20% integration, 10% E2E tests for most systems.

Test Distribution Guidelines

What you'll learn: You'll discover the practical "70/20/10" rule for balancing different types of tests in most software systems.

The 70/20/10 Rule

While the testing pyramid shows us the shape of good test suites, you need concrete guidance on actual proportions. The widely-used guideline for most systems is:

  • 70% Unit Tests – Fast, focused tests that verify individual functions, methods, and classes in isolation
  • 20% Integration Tests – Tests that check how components work together (database connections, API calls, module interactions)
  • 10% End-to-End Tests – Full system tests that simulate real user workflows through the entire application

Why These Numbers?

Think of your test suite like a security checkpoint at an airport. You want lots of quick metal detector scans (unit tests) to catch common issues instantly. Fewer bag X-rays (integration tests) verify things work together properly. And only occasional full inspections (E2E tests) confirm the complete experience because they're time-consuming.

Unit tests run in milliseconds and pinpoint exact failures. Integration tests take seconds and catch interface problems. E2E tests take minutes but ensure everything truly works from the user's perspective.

Adapting the Guidelines

These ratios aren't rigid law—they're starting points. A microservices architecture might need more integration tests (maybe 60/30/10). A simple CRUD app might lean heavier on E2E tests (60/25/15). The key is maintaining the pyramid shape: more fast tests at the bottom, fewer slow tests at the top.

Your test suite should run frequently without slowing development. If your full suite takes hours, you've likely inverted the pyramid.

Key Takeaway: Aim for roughly 70% unit, 20% integration, and 10% E2E tests to balance speed, confidence, and maintainability—but adjust based on your system's specific needs while keeping the pyramid shape intact.