Skip to Content
MetricsNew, Churn, and Refactor

New, Churn, and Refactor

WHY IT MATTERS

Pull requests are categorized into four types: new, churn, refactor, and other. While a balance of churn and refactor is needed to maintain and improve quality, teams should optimize for shipping more new code on a sustained, long-term basis.

HOW IT’S MEASURED

Work breakdown is measured as both a rate and a count of pull requests.

Rates show the percentage of work in each category. For example, churn rate measures the percentage of line changes that involve recently merged code.

We combine these rates with the total number of pull requests to quantify the total effort in each category. To get your team’s overall work breakdown, we take the average work breakdown across all pull requests and then multiply by the number of pull requests merged. For example, new deliveries = pull requests × percentage new code.

New

It is important to note that these definitions are not the same as additions and deletions. For example, your Git provider will capture the change below as 1 addition and 1 deletion. We categorize this change as 1 line of rework (either churn or refactor, depending on how recently the line was last modified).

Rework

Whereas measuring additions and deletions overcounts new code by 1 in this example, our definition more accurately reflects your team’s net new changes being delivered.

RELATED ARTICLES

Last updated on