Cobertura de testes mede quanto do código é executado pelos testes — tipicamente como uma porcentagem (ex: 80% de cobertura). É uma métrica útil para encontrar código não testado, mas é importante entender suas limitações: alta cobertura não garante bons testes.
O que a cobertura mede
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.
