Measuring Developer Productivity: Don't Count Lines of Code
"How do I know if my developers are working?" This is the question bad managers ask. They try to count:
- Lines of Code (LOC).
- Commits per day.
- Hours online.
These are Vanity Metrics. They are easily gamed. (I can write 1000 lines of garbage code in 1 hour. Am I productive?)
Good managers measure Outcomes, not Output.
Here is what we'll cover:
- Why LOC is evil.
- The DORA Metrics: The industry standard.
- The SPACE Framework: Measuring the human side.
1. Why Lines of Code (LOC) is Evil
Bill Gates famously said: "Measuring programming progress by lines of code is like measuring aircraft building progress by weight."
Sometimes, the most productive day is when I delete 500 lines of code. I made the system simpler, faster, and easier to maintain. My "Net LOC" is -500. According to the metric, I had a negative impact. According to reality, I saved the company money.
Rule: Never, ever use LOC as a KPI.
2. DORA Metrics (The Golden Standard)
Google's DevOps Research and Assessment (DORA) team studied 30,000 companies. They found 4 metrics that correlate with high performance / business success.

- Deployment Frequency: How often do you ship? (Elite: On-demand / Multiple times a day).
- Lead Time for Changes: How long from "Commit" to "Production"? (Elite: < 1 hour).
- Change Failure Rate: How often does a release break? (Elite: < 15%).
- Time to Restore Service: If it breaks, how fast do you fix it? (Elite: < 1 hour).
Why these work: They measure Velocity AND Quality together. You can't cheat by shipping garbage fast (Failure rate goes up). You can't cheat by being too cautious (Frequency goes down).
Important: Stop using "Velocity" (Story Points) as a target. Velocity is for capacity planning, not for performance reviews.
Goodhart's Law: "When a measure becomes a target, it ceases to be a good measure."
Case Study: The Velocity Trap
I once worked with a team that set a OKR: "Increase Sprint Velocity by 20%."
What happened?
- Engineers started estimating "3 points" for "1 point" tasks. (Point inflation).
- They stopped writing tests to finish faster.
- They broke big stories into tiny fragments to "close more tickets."
The Result:
- Velocity went UP π.
- Bugs went UP π.
- Customer trust went DOWN π.
We replaced this with Deployment Frequency and Change Failure Rate. The team focused on automating deployments (Frequency up) and writing better tests (Failure Rate down). Productivity actually improved because they stopped gaming the system.
3. The SPACE Framework (The Human Side)
DORA measures the pipe. SPACE measures the people.
- Satisfaction: Are devs happy? Or are they burning out?
- Performance: Usage metrics (outcomes).
- Activity: Design docs, code reviews (the work).
- Communication: Is information flowing?
- Efficiency: Do they have flow? (Or are they stuck in meetings?).
Example: If DORA scores are high (shipping fast), but Satisfaction is low (everyone hates it), your team will quit in 3 months. You need both.
Summary
- Ignore LOC. It tells you nothing.
- Track DORA. Optimizing these 4 numbers will fix your engineering culture.
- Check Pulse (SPACE). High velocity implies nothing if your team is quitting.
