العودة إلى القاموس
الاختبارPopular

Code Coverage

A metric that measures the percentage of code executed during testing, indicating how much of the codebase is covered by automated tests.

التعريف

Code coverage tools track which lines, branches, functions, and statements are executed during test runs. Common coverage metrics include: Line Coverage (lines executed), Branch Coverage (decision paths taken), Function Coverage (functions called), and Statement Coverage (statements executed). Tools like Istanbul (JavaScript), Coverage.py (Python), and JaCoCo (Java) generate coverage reports.

لماذا هو مهم

80% code coverage is a common industry target. However, high coverage doesn't guarantee quality — it's possible to have 100% coverage with poor tests. Coverage is most useful for identifying untested code paths. Studies show teams with >70% coverage have 40% fewer production bugs.

مثال

A coverage report shows that the payment processing module has 95% line coverage but only 60% branch coverage, revealing that error handling paths need more tests.

المصطلحات ذات الصلة

code coveragetest coveragewhat is code coveragecode coverage percentage

أتمتة مراجعة الكود مع diffray

نظام ذكاء اصطناعي متعدد الوكلاء لمراجعة الكود. يجد الأخطاء والثغرات الأمنية ومشاكل البنية تلقائياً.