What is Code Coverage?
Turkish: Test Kapsamı
Code coverage shows which lines, branches, or functions automated tests executed, helping reveal untested parts of a codebase.
What is Code Coverage?
Code coverage measures which parts of a codebase were executed while automated tests ran. It is often shown as line coverage, but branch, function, and statement coverage are also common.
An 80% coverage number does not mean 80% of the code is correct. It only means that portion was executed during tests. If tests contain no assertions or assert the wrong behavior, coverage can be high while quality remains low.
How Should It Be Used?
Coverage reports reveal untested files, error-handling paths, and edge cases. Low coverage in payment, authorization, pricing, or data transformation code carries more risk than low coverage in a simple display component.
Teams often set minimum thresholds, but the goal should not be raising the percentage for its own sake. Meaningful scenarios, readable test data, and correct assertions matter more than the headline number. Branch coverage can provide a stronger signal than line coverage when conditional logic is complex.
Unit tests are a primary source for coverage reports. In TDD, tests are part of the design process, so coverage becomes a consequence of disciplined development rather than a number chased afterward.