Code churn

Code that is deleted/rewritten within 21 days of merging is called code churn or rework. Code churn or rework is different from refactored code because refactored code is code that is modified after 21 days. This is usually an acceptable change needed for maintenance and is therefore separated out from code churn so as not to raise flags.

What does code churn signal?

  • High code churn generally signals problematic code areas or frequency changing task definitions/requirements thus hurting developer productivity and experience. 
  • It can also help you track progress of of new hires as they move from high churn as the newly join to coming down to the team’s average as they become comfortable with the code base. 
  • Additionally, code that is replaced by engineers other than the author of the original code within 21 days of authoring can mean the code changes can be team work or helping others. This is helps you measure to what extent developers are helping their team mates to improve code quality and delivery.