Test coverage, kodun ne kadarının testler tarafından çalıştırıldığını ölçer — tipik olarak yüzde olarak ifade edilir (örneğin %80 coverage). Test edilmeyen kodu bulmak için yararlı bir metrik olsa da, sınırlamalarını anlamak önemlidir: yüksek coverage iyi testleri garanti etmez.
Coverage'ın ölçtüğü şey
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.
