← Reference · Nestor G Pestelos Jr · Print this page

Software Engineering · Measurement

Code Churn

Reference entry · last updated 20260908

Code churn measures changes to code over a specified period. Definitions vary: a study may count changed lines or normalize changes against component size. The formula and time window must accompany the number.[1]

First principles and definitions

An absolute measure counts changes. A relative measure divides changes by another quantity, such as codebase size. Additions, deletions, and modifications must be counted consistently; different definitions are not interchangeable.

Faros’s definition

Faros’s 2026 report uses deleted lines divided by added lines in merged code during a quarter.[2]

Illustrative example: 200 deleted lines and 1,000 added lines give a ratio of 0.2. The ratio does not identify the age of the deleted lines. It cannot alone distinguish replacement of recent code from removal of old code.

Interpreting churn

In a Windows Server 2003 case study, Nagappan and Ball found their relative churn measures more useful for predicting defect density than absolute churn measures.[1] That result concerns the study’s measures and system; it does not establish a universal defect threshold.

Code changes also serve maintenance and evolving requirements. Churn should be interpreted with change purpose and defect evidence, rather than treated as waste by definition.

See also

References

  1. Nachiappan Nagappan and Thomas Ball, 2005. Use of Relative Code Churn Measures to Predict System Defect Density.
  2. Faros Research. Ten takeaways from the AI Engineering Report 2026: The Acceleration Whiplash.