Main Points
- Track pull request size, review turnaround and work in progress first, because they reveal most flow problems.
- Pair a speed metric with a quality metric so teams cannot trade one for the other.
- Collect by hand for a month and automate only the numbers that change decisions.
- Never use a metric to rank individual developers.
Metrics are the daily instruments of a team, KPIs are the dashboard leaders glance at. The seven metrics below are the ones I reach for first in an engineering review, because each one points at a specific habit a team can change within a sprint or two.
They sit one level below the numbers leaders report. An outside software engineering consulting review collects both layers in a single baseline. If you also need the numbers leaders report, my explanation of software engineering KPIs covers the top layer.
The 7 Metrics, Their Formulas and Healthy Ranges
Ranges depend on your product and team size, so treat them as starting points. What matters is the trend over a quarter.
| Metric | How to calculate it | Common starting target |
|---|---|---|
| Pull request size | Lines changed per merged pull request, median | Under 400 lines |
| Review turnaround | Hours from review request to first response, median | Under one working day |
| Build health | Share of green builds on main, plus median build minutes | Over 90 percent green, under 10 minutes |
| Flaky test rate | Tests that pass and fail on the same code, divided by all tests | Under 1 percent |
| Code churn | Share of new code rewritten or deleted within three weeks | Falling trend |
| Time to detect | Minutes from failure start to the first alert | Under 10 minutes for critical paths |
| Work in progress | Open items per developer at one time | One or two |
1. Pull Request Size
Big pull requests are the quiet cause of slow delivery. Reviewers postpone them, mistakes hide inside them and merge conflicts grow with every day they stay open. Median lines changed is crude, yet it predicts review time better than almost anything else I have tracked.
Do not set a hard limit on the first day. Look at the distribution for a month, then ask the authors of the largest ten pull requests why they were big. The answers are usually a missing feature flag, an unclear ticket or a refactor mixed with a feature. Fix those causes and the median drops by itself.
2. Review Turnaround Time
Review turnaround is the wait between asking for a review and getting a first response. Developers who wait a day switch to another task, and the context switch costs more than the wait itself. A team with a median under four working hours feels fast to its members even when everything else is average.
Agree on a simple norm, for example a first response within one working day, and show the metric on the team board. Pair it with pull request size, since small pull requests are the easiest to review quickly. If one person reviews most changes, you have found a bottleneck worth solving with code owners and rotation.
3. Build Health: Green Rate and Duration
A red main branch blocks everybody, and a 40-minute build teaches people to skip checks. Track two numbers together: the share of builds on the main branch that finish green, and the median build time. Both come straight from your CI system.
Long builds usually have boring causes: no dependency caching, tests running one after another, or a heavy end-to-end suite on every commit. Splitting the suite into fast checks on every change and slower checks on merge cuts most of the time. The software engineering tools I rank include several CI services that report these two numbers with no setup.
4. Flaky Test Rate
A flaky test passes and fails on the same code. Every one of them trains the team to rerun and ignore red builds, which erodes trust in the whole suite. Most CI services can report tests that failed and then passed on retry. Divide those by all tests and you have the rate.
Treat anything above one percent as a problem that needs an owner. Quarantine the test the day it is found so it stops blocking merges, and give it a week to be fixed or deleted. Flakiness often points at shared state, timing assumptions or tests that depend on external services, which makes it a good indicator of deeper design problems.
5. Code Churn
Code churn measures how much recently written code is rewritten or deleted shortly afterwards, commonly within two to three weeks. Some churn is healthy, because people refine what they just wrote. A rising trend on one module, however, signals unclear requirements, design uncertainty or a fragile area.
Use churn as a pointer to conversations, not as a score. Combine it with change frequency to find hot spots: files that change often, break often and churn often. Those files get the first slice of your debt budget. The software engineering roadmap shows where that work fits in a year.
6. Time to Detect
Time to detect is the gap between the start of a failure and the moment a person or alert notices it. A team that learns about an outage from customers has a detection problem long before it has a recovery problem. Measure it from incident reviews: when did errors start according to logs, and when did the first alert fire?
Shorten it with a few well-chosen alerts on customer-facing behavior, such as checkout errors or login failures, rather than dozens of server health checks. Review every incident for the earliest signal that was available and ask why it did not page anyone.
7. Work in Progress
Work in progress counts how many items each developer has open at once. It sounds like a project management metric, yet it drives engineering outcomes: more open items mean more switching, longer cycle times and more half-finished work. A limit of one or two items per person speeds up delivery in nearly every team I have seen try it.
Count open items on the board every morning for a month and plot the average. If the number is above three, finish work before starting more. The hurdles that make teams resist this, such as pressure to look busy, are described in my piece on software engineering challenges.
How to Collect All Seven Without Building a Dashboard
Teams often delay measuring because they believe they first need a data platform. You do not. Your Git host exposes pull request size, review timestamps and merge times through its API or a built-in insights page. Your CI service reports build results, durations and retries. Your issue tracker shows open items per person. The only metric that needs a manual step is time to detect, which you take from incident reviews.
Run a small script once a week and paste the medians into a shared sheet. Include a column for what you changed that week, so the sheet doubles as a log of cause and effect. After four weeks you will know which numbers move when you change something and which ones sit still no matter what you do. Keep the first group and drop the second.
When you do automate, pull the data into one place and show trends, not single values. A line over twelve weeks tells a story that one number never will. Add the team's own commentary under each chart, because a number without a sentence of context gets misread by everyone outside the team.
Metrics Worth Skipping
Some popular numbers do more harm than good. Lines of code written rewards verbosity. Commit counts reward noise. Hours logged measure presence. Story points completed per developer invite inflation and unfair comparisons. Code coverage as a single percentage target leads to tests that execute code without checking behavior. If you already track these, you can keep them for planning but never for judging people.
Be just as careful with metrics that look scientific. Cyclomatic complexity, for example, has real value when you look at one module that keeps breaking, and almost none as a company-wide average. Context turns a number into information. A metric without a question behind it, such as why a given module breaks so often, is a chart waiting for someone to ask what it means.
A good test is whether anyone would act on a change, and whether the person who would act on it sees the number at all. If a metric moved by half and nobody would do anything differently, drop it from the list and spend the attention elsewhere. Fewer, sharper metrics get read; long dashboards get ignored within a month.
How to Pick Your First Three Metrics
You do not need all seven at once. Match the first three to the symptom your team complains about most:
- Work waits for people: start with review turnaround, pull request size and work in progress.
- Builds and tests annoy everybody: start with build health and flaky test rate.
- Production surprises you: start with time to detect and code churn on the failing modules.
Collect by hand for the first month. A spreadsheet fed by a weekly export is enough to tell you whether the metric changes decisions. Automate only the ones that do, and retire any metric nobody mentions in a retrospective after a quarter.
Questions About Software Engineering Metrics
What Are Software Engineering Metrics?
They are measurements of how software is built and delivered, such as pull request size, build time, review turnaround and time to detect failures. Good metrics describe the process and the flow of work. They help a team find where work waits and where quality slips, and they should lead to decisions.
What Is the Difference Between Metrics and KPIs?
A metric is any measurement. A KPI is a metric that a named person reviews on a schedule and acts on. Teams track many metrics for diagnosis and report a few KPIs upward. Review turnaround is a team metric, lead time is the kind of number leaders usually track as a KPI.
Which Software Engineering Metrics Matter Most for Small Teams?
Pull request size, review turnaround and work in progress, because they need no extra tooling and reveal most flow problems. Add build health once a CI pipeline exists. Small teams can skip formal reporting and just look at the numbers together in their retrospective.
How Do We Collect Metrics Without a Dashboard?
Export data weekly from your Git host and CI system into a spreadsheet, then chart the median and the trend. For a first month this is enough. Build automated dashboards only after you know which numbers change your decisions.
Should We Measure Individual Developers?
No. Individual numbers are easy to game and ignore the differences in the work developers do, such as mentoring, reviews and incident duty. Measure teams and systems. If a person has a problem, a conversation reveals it faster than any number.
How Often Should We Review Engineering Metrics?
Look at flow metrics weekly in the team, at stability metrics after every incident and at trends monthly with leadership. Quarterly reviews of the metric list itself keep the set small, because a metric nobody uses should be dropped.
Does Code Coverage Belong on the List?
As a single percentage target, no. Coverage shows which code tests execute, not whether they check anything useful. It is better as a map of untested risky areas. Track coverage on your most critical code paths and use it to guide where to add tests.
Please note: this guide is general information and not legal, financial or tax advice. Numbers and examples are typical-project estimates; confirm current details with your providers and advisers.
Did this article help you?
Thanks, noted.
Whitney Sorensen
Whitney leads the Umber editorial team and works with the consultants to turn real client projects into practical guides on software selection, custom development, integration and legacy modernization. Before joining Umber, she spent years writing and editing for engineering and IT teams. She has since reviewed architecture audits, system selections and modernization plans from client projects across industries from manufacturing to healthcare. She works remotely from the USA.