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:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →