Scrierea testelor bune — care sunt fiabile, ușor de întreținut și valoroase — urmează practici bine stabilite. Testele slabe (fragile, lente, necitite) devin o povară, în timp ce testele bune oferă o valoare durabilă. Înțelegerea acestor practici este importantă pentru testarea eficientă.
Caracteristicile testelor bune (FIRST)
FAST → run quickly (so they're run often)
INDEPENDENT/ISOLATED → don't depend on each other or order; each sets up its own state
REPEATABLE → same result every time, any environment (no flakiness)
SELF-VALIDATING → clear pass/fail (assertions, not manual inspection)
TIMELY → written with (or before) the code
