Unit Test Smells
Issues in test code.
Table of Contents
- Fragile Test: Fails due to unrelated changes.
- Obscure Test: Hard to understand verification logic.
- Test Logic in Production: Production code contains
if (testing)hooks. - Assertion Roulette: Multiple assertions without messages.
- Slow Tests: Slow tests won’t be run.
- Mystery Guest: Test relies on external resources not visible in test.
- General Fixture: Setup is too big/general for the specific test case.
- Eager Test: Checking too much functionality in one test.