Impact: a better way to measure codebase change
From the early days at Apple, Andy Hertzfeld highlights why managing by Lines of Code is sort of ridiculous:
Bill Atkinson … had completely rewritten the region engine using a simpler, more general algorithm which, after some tweaking, made region operations almost six times faster. As a by-product, the rewrite also saved around 2,000 lines of code.
He was just putting the finishing touches on the optimization when it was time to fill out the management form for the first time. When he got to the lines of code part, he thought about it for a second, and then wrote in the number: -2000.
Moving Beyond Counting Lines of Code
Contributions in software take on different forms, and distinguishing them requires greater care than weighing raw lines of code.
To break this down a little further, consider the following example:
One engineer makes a contribution of 100 new lines of code to a single file.
Compare that to another engineer’s contribution, which touches three files, at multiple insertion points, where they add 16 lines, while removing 24 lines.
The significance of each contribution can’t be boiled down to just the amount of code being checked in. Even without knowing specifics, it’s likely that the second set of changes were more difficult to implement, given that they involved several spot-edits to old code.
The engineer’s path probably looked something like this:
- Read the old code
- Invest time in understanding the original intent of that code
- Check whether intended changes might create collateral damage
- Make the changes
- Remove and cleanup any irrelevant code
- Sanity check the approach afterwards
Compared to greenfield development, which skips over half of these steps, the second contribution carries a much higher cognitive load. This also demonstrates why simplistic metrics fail to describe the work involved in software engineering.
“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” — Bill Gates
Instead, consider way to measure the significance of code changes that respects the nuances of software engineering. It’s called it Impact.
Impact attempts to answer the question: “Roughly how much cognitive load did the engineer carry when implementing these changes?”
Impact takes the following into account:
- The amount of code in the change
- What percentage of the work is edits to old code
- The surface area of the change (think ‘number of edit locations’)
- The number of files affected
- The severity of changes when old code is modified
- How this change compares to others from the project history
In the example from earlier, the second contribution is more impactful: The change modifies previous work, the edits happened in 4 different locations, and 3 different files were affected.
Even without knowing the severity of changes or comparing to historical changes, it’s probably safe to assume that the second contribution was more ‘expensive,’ and therefore carries is higher impact score.
Three ways to use Impact
Here are a few ways engineering teams use impact to gauge contributions and recognize engineering performance:
1. Did our staffing changes make a difference?
Throwing more bodies at software development does not guarantee for moving faster. As Fred Brooks pointed out, “adding manpower to a late software project makes it later.” Impact allows teams to understand and communicate about how staffing changes affect progress.
Over the course of a year, one company scaled and substantially staffed up their engineering team. Using impact, this leader had concrete data for the board room:
“We quadrupled our staff this year, and were under pressure to show that this was a good move. By comparing impact before and after, we were able to demonstrate that staffing up has helped us ship features more than 4x faster. Not only was staffing up a good idea, it relieved the pressure on our existing team helped them to be even more effective.” —Director of Engineering
2. Who are the silent heroes?
It’s not too difficult to recognize and congratulate highly visible work, like when someone ships a shiny new feature. But managers can have had a tough time when it comes to noticing less glamorous work like paying down technical debt.
By paying attention to impact, unsung heroes get recognized:
“If we hadn’t been able to see it, we wouldn’t have realized how much Aaron had been contributing behind the scenes. Last month he did over half of all the work in one repo and really carried this re-implementation.” — CTO
3. Does yesterday’s work match today’s standup?
People don’t always like to raise their hand if they’re stuck. Sometimes it’s a matter of pride, and other times it feels like a solution to a tough problem is right around the corner.
When the only feedback loop is the daily standup, this can be particularly challenging. It forces team leads to rely on self-reporting to gauge if their team is moving the ball forward.
With the addition of hard data—particularly data is that’s aware enough to understand when someone is working on a hard problem—managers can know where to focus:
Does movement in the codebase match the narrative from today’s standup? If there’s a large delta between the two, the manager knows where to investigate.
“By keeping tabs on daily impact, I have a much better idea of who is on a roll, and who might need some extra help.” — Engineering Manager
These are just a few of the ways that engineering managers are using Impact to think about codebase change and lead their teams more effectively. We’d love to hear your ideas on useful metrics for software engineering.
Ben Thompson is a co-founder at GitPrime where he leads design and customer experience. He is a Y Combinator alumni, with a background in product design, branding, and UX design. Follow @thebent on Twitter.
Get Engineering Impact: the weekly newsletter for managers of software teams
Keep current with trends in engineering leadership, productivity, culture, and scaling development teams.