lecture 10 of 160 completed

Keeping three thousand tests alive

Large suites die from entropy, not from bugs. Selector governance, dead test detection, and the decision to delete.

What you'll learn

  • The three ways a large suite decays
  • Why deleting a test is a legitimate decision
  • Which numbers make the case for time to fix it

Large suites tend to develop the same three diseases: selectors nobody governs, tests nobody can justify, and a refactor everyone is afraid to start. None of them are bugs. They are entropy, and entropy needs a process rather than a fix.

Disease one: selector drift.

Four teams, four conventions. Some tests use data-testid, some use CSS classes, one file uses XPath through a plugin someone added in 2023. A UI redesign breaks two hundred tests and nobody can estimate the repair.

The cure is a written policy plus a lint rule. The policy is one paragraph: test IDs are required on interactive elements, named data-testid, in kebab-case, added by the developer writing the component. The lint rule is what makes it real:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →