Acoperirea testelor măsoară cât din cod este executat de teste — de obicei ca procent (de exemplu, 80% acoperire). Este o metrică utilă pentru a găsi codul netestet, dar este important să înțelegi limitările sale: acoperirea ridicată nu garantează teste bune.
Ce măsoară acoperirea
TEST COVERAGE = the % of code exercised by the test suite:
LINE coverage → % of code lines executed by tests
BRANCH coverage → % of branches (if/else paths) taken
FUNCTION coverage → % of functions called
STATEMENT coverage → % of statements executed
→ Coverage tools instrument the code and report what tests do/don't exercise.
