What Is Code Churn and How Does It Impact Businesses?

Written By Naomi Chopra

code churnMeasuring engineering performance and productivity for individuals, as well as teams, is a persisting challenge. This is because of the high costs and complex processes involved and the abundance of metrics that may not holistically reflect productivity or business impact.

The challenge is also compounded by the fact that some of the metrics conventionally used like lines of code (LOC) can be brute forced into reflecting better numbers when in reality they might not be as ideal. LOC is the number of lines of code in a commit. This is a prime example of a metric that can be gamed by pushing frequent low-impact code, thus becoming a metric that doesn’t necessarily reflect the impact it has on the business.

Challenges like these send leaders looking for metrics that can definitely be used to measure the impact of the software development process on business outcomes. One such metric is code churn. In this post we’ll take a look at what code churn is and how code churn impacts the business negatively on many fronts if left unchecked.

What Is Code Churn?

Rework, or code churn, is code that is edited within three weeks of the first merge and is represented as a percentage of rework on the code base. A higher code churn is considered undesirable and stands on the premise that changes that require the alteration of earlier work in a short time period can be a sign of inefficiencies and hidden underlying issues.

As with most metrics, code churn varies from one person to another, one team to another, or one project to another. The variability in teams and the products they work on are why it becomes important for leaders to track these metrics across a few dimensions and over a few sprints or weeks to set a baseline that’s suitable for their engineers, teams, and projects.

Industry experts consider that an overall code churn of about 15-25% is acceptable to most teams, with 15% or less being a sign of normal to highly efficient teams.

How Does Code Churn Impact Business?

Changes in code base are the underlying data that goes into the code churn metric. But not all changes to the code base are bad. Code churn as a result of frequently changing code base can mean high development velocity and high rates of feature releases. This kind of code churn is common and acceptable.

On the other hand, the not-so-desirable reasons like high rates of bugs released into production that needed fixing, low quality reviews and testing, low code reusability, etc. also cause frequent changes to code, which result in code churn that needs to be investigated.

How code churn impacts business outcomes can be broken down into four perspectives: customer experience, inefficiencies in tools and processes, employee well-being, and employee recognition and retention.

Customer Experience

One of the most important, if not the most important, impacts of code churn on the business is the resulting negative or substandard experience for customers.

Larger changes in code show up as high code-churn levels. Having larger code changes also means there is a higher chance of bugs creeping in post release and not identifying vulnerabilities on time—both of which have a negative impact on the customer experience. This makes code churn a crucial metric that can be used to proactively identify issues such as those I mentioned above and take precautionary measures.

Inefficiencies in Tools and Process

Code churn can be a result of many underlying factors like the tools the teams use (e.g., Slack, Jira, Zoom, PagerDuty, etc.) or processes the teams use (e.g., PRDs, Agile, functional programming, etc.).

With remote and hybrid work being adopted widely, the tools used by the teams and the processes with which all processes—including communication and collaboration—occur form the bedrock on which businesses are able to function, providing value to customers.

Frequent changes in the PRD, unclear requirements, or unclear architecture guidelines are all signs of disconnect between the product team that gathers requirements from customers and the engineering team that uses these documents as a base to build out features. This is an issue that results in high code churn and hence can help managers and leaders use code churn as a metric to identify inefficiencies in tools and processes.

Employee Well-Being

Employee well-being is one of the most crucial aspects to running a successful business. This is because employees’ well-being directly affects the quality of their work, which in turn affects the business and vice versa.

Inefficiencies in processes such as the ones we saw above tend to ripple out into broader issues that are harder to detect and address.

Code churn is built upon data from changes in code, which means it is a more accurate representation of the work being completed. This recency of data in code churn means that high code churn numbers can bring out inefficiencies like unbalanced task allocation, miscommunication, or inaccurate assessment of the engineer and their capabilities in solving the problem assigned.

Real life examples of these issues can be seen in the form of changing requirements that force engineers to churn more code, which means overwork leading up to burnout. Other examples like communicating via different channels that are not expected to be used for this purpose can cause distractions, app fatigue waiting and checking multiple channels, etc., which can eventually lead to overwork and burnout.

These issues have a negative effect on the mental health and well-being of engineers, and code churn can help identify trends that might lead managers to detect signs of burnout in a more accelerated fashion.

Employee Recognition and Retention

code churnOne of the challenges managers and leaders face in running a team is duly recognizing employee contributions.

Code churn can help leaders to objectively view the performance of any engineer and use it in conjunction with other metrics not just for performance reviews but also to build a culture that respects and rewards quality work. Naturally, this aids immensely in the process of retaining employees.

Recognizing and retaining the best performers is what builds successful, innovative companies, making code churn an important metric to pay attention to.

Code Churn Has a Strong Business Impact

From helping detect customer experience issues to employee related issues like burnout and recognition, code churn can help engineering leaders to take timely, data-driven, and impactful decisions in order to effectively contribute to the business on all the three fronts: better product and a better customer experience, improved internal tooling and process improvements, and finally a culture that works toward better employee well-being.

To get started with code churn, it's best to consider an engineering analytics platform like Hatica, which makes the process quick and simple by tracking code churn and other engineering metrics for your teams. Just connect your Github, Gitlab, or any other code hosting platform you use and let Hatica deliver code-churn dashboards in minutes.

From all the various metrics one can use to examine the impact of software development on business processes, code churn is arguably the one that can deliver the most highly accurate and recent insight. Understanding it and using it can be a game-changer for your business.