test-refactoring-catalog

Catalog of safe test-code transformations — each transformation preserves behavioral coverage while improving readability, maintainability, and signal-to-noise ratio.

When to use

Entry contract

Exit contract

Invariants

Why this shape

A well-named test is an executable specification. Refactoring tests improves living documentation without touching coverage. The R1–R7 decision flow prevents over-engineering: each transformation responds to a specific smell and stops there.

« Any fool can write code that a computer can understand. Good programmers write code that humans can understand. » — Fowler, M., Refactoring, 2nd ed., 2018.

The behavior-preservation rule applies with the same rigour as the Iron Rule of Tests: no deletion, no neutralisation.

Allowed customisation

See also