FIRST principles of testing
The FIRST principles of testing are a mnemonic for five qualities that good automated tests should have. Tests should be Fast, Isolated, Repeatable, Self-validating, and Timely. The acronym is widely used as a checklist when evaluating a suite of automated tests.
- Fast – tests run quickly so that developers run them often and get rapid feedback.
- Isolated – each test checks one behavior and does not depend on the state or outcome of other tests.
- Repeatable – tests produce the same result every time, regardless of the environment or run order.
- Self-validating – tests pass or fail without manual interpretation of their output.
- Timely – tests are written close to, or before, the code they exercise.
Fast and repeatable tests are the foundation of unit testing, since a unit test that is slow or environment-dependent stops being a unit test in spirit. Isolation and self-validation matter most at the testing suite level, where flaky or ambiguous results erode trust. The Timely principle is the bridge to test-driven development, where the test is written before the production code it guides.