Test coverage yana auna nawa jiya code ana aiwatarwa ta hanyar gwaje — galibi a fiye kashi (misali 80% coverage). Shi matsayi mai amfani ne don nemo code da bai gwajuwa ba, amma yana da mahimmanci ganinsu iyakoki: coverage mai girma bai bada garantin bukatun gwaje ba.
Abin da coverage yake auna
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.
