良い意図であっても、チームはテストアンチパターンに陥りやすいものです。これらのアンチパターンはテストを脆く、遅く、信頼できなく、低価値にしてしまう慣行です。これらを認識し、避けることは、健全で価値のあるテストスイートを維持するために重要です。
テスト品質アンチパターン
✗ TESTING IMPLEMENTATION DETAILS → tests coupled to internals → break on every refactor
(brittle) → test BEHAVIOR/outcomes instead
✗ FLAKY tests → intermittent failures erode trust → people ignore failures (real ones too)
✗ OVER-MOCKING → mocking everything → tests verify mock interactions, not real behavior;
brittle and give false confidence
✗ Tests with NO meaningful assertions → run code but verify nothing (false coverage)
✗ GIANT tests checking many things → unclear what failed; hard to maintain
構造的および戦略的アンチパターン
✗ ICE CREAM CONE → mostly slow E2E/manual, few unit tests → slow, brittle, expensive suite
✗ INTERDEPENDENT tests / shared mutable state → order-dependent, flaky, fragile
✗ Testing the FRAMEWORK / trivial code → low value; testing what doesn't need testing
✗ Chasing COVERAGE numbers → low-value tests written just to hit a percentage
✗ Slow tests → discourage running them → defeats fast-feedback value
