Test coverage मापता है कि code का कितना हिस्सा tests द्वारा निष्पादित होता है — आमतौर पर एक प्रतिशत के रूप में (जैसे 80% coverage)। यह बिना परीक्षित code खोजने के लिए एक उपयोगी metric है, लेकिन इसकी सीमाओं को समझना महत्वपूर्ण है: उच्च coverage अच्छे tests की गारंटी नहीं देता।
Coverage क्या मापता है
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.
