Repaso
Español
TestingCoreTST-40

Why should the UI test automation suite be small compared to unit tests?

Options

  1. UI tests are slow and brittle, so keep only a few (Correct option)
  2. UI tests are free to maintain, so write many more
  3. Unit tests cannot find real bugs in the logic
  4. Browsers are very fast, so UI tests are cheap

Answer

UI tests are slow, brittle and expensive to maintain, so keep a few critical end-to-end flows and test most logic at lower levels (the test pyramid)

Why

Test pyramid: many unit tests (fast, cheap), fewer integration tests, very few UI/E2E tests (slow, depend on browsers, network, data).

Use UI automation for the most important user journeys (login, purchase) and smoke tests after deployment.

Test business rules, validation and edge cases through unit or API tests.

Remember

Few UI tests, many unit tests.

Key terms

Practice this question in Repaso