Introduction
Tests should work on their own without relying on other tests. This helps find problems faster and keeps tests reliable.
When writing multiple tests for a feature that share some setup
When fixing a bug that appears only when tests run together
When adding new tests to an existing test suite
When tests sometimes fail randomly without code changes
When running tests in parallel or on different machines