La copertura dei test misura quanto del codice è eseguito dai test — tipicamente come percentuale (ad es. 80% di copertura). È una metrica utile per trovare il codice non testato, ma è importante comprenderne i limiti: un'alta copertura non garantisce test di qualità.
Cosa misura la copertura
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.
