AIProductivityDevelopmentMetrics

Measuring Developer Productivity with AI Code Generation

Explore the new challenges and methods for measuring developer productivity in an era where AI assists in writing code. Understand how traditional metrics shift and what new approaches are needed to accurately assess performance with AI collaboration.

·23 min read
blog cover image
Table of Contents

If AI writes more code but your lead time, reliability, or rework gets worse, productivity went down.

01 THE PROBLEM

Developer productivity measurement is the failure mode where organizations confuse code generation with engineering progress.

That distinction mattered before LLMs. It is existential now.

When AI can produce 500 lines in minutes, old proxies like commits, pull requests opened, lines changed, or tickets closed become actively misleading. They were always weak signals. With AI assistance, they can point in the wrong direction with high confidence.

The core gap is simple: most teams can measure activity, but they cannot reliably measure whether AI reduced the time to deliver valuable, maintainable, low-risk software.

That gap creates bad decisions fast.

A CTO sees acceptance of Copilot, Cursor, or Claude Code spike in two weeks. Pull request volume rises. Engineers report feeling faster. Finance sees higher tool spend. Leadership assumes the ROI is obvious. Three months later, review queues are longer, incidents tick up, architectural consistency degrades, and senior engineers spend more time cleaning up generated code than shipping leverage.

By then, the damage is already embedded in the codebase.

This is why “measuring developer productivity when AI writes the code” is not a tooling question. It is an operating model question. You are deciding what counts as progress in an environment where output has become cheap but verification has become expensive.

DORA’s four key metrics—deployment frequency, lead time for changes, change failure rate, and time to restore service—remain useful because they measure delivery system performance, not typing speed. Nicole Forsgren, Jez Humble, and Gene Kim made that case in Accelerate, and Google Cloud’s DORA research has kept reinforcing the same point: the highest-performing organizations optimize for delivery and stability together, not output in isolation.

AI changes the local economics inside that system.

It lowers the cost of producing candidate code.

It does not lower the cost of understanding code, integrating code, reviewing code, validating edge cases, debugging production behavior, or maintaining consistency across a long-lived system. In some teams, it increases those costs.

That is the real tension: AI shifts effort from creation to verification, but most organizations still measure creation.

The consequence shows up on a short timeline.

In the first 30 days, teams report speed.

In 60 to 90 days, review burden and code variance start to surface.

In one to two quarters, the real effects appear in lead time, escaped defects, incident rate, and backlog quality.

If you only track “AI usage” or “suggestions accepted,” you will miss the point entirely. A team can have high AI adoption and lower engineering productivity at the same time.

The METR study on experienced open-source developers is a useful correction to hype here. In its 2025 study of experienced contributors working in large repositories they knew well, METR reported that AI tools made developers take 19% longer on average. The important point is not that “AI makes everyone slower.” It is that real-world impact is context-dependent and often diverges sharply from self-reported sentiment. Experienced developers predicted speedups but measured slowdowns.

That mismatch should make every engineering leader more cautious about simplistic dashboards.

What matters is not whether AI wrote the code.

What matters is whether the team shipped the right change faster, with less friction, without raising the future cost of change.

02 WHY IT HAPPENS

The root cause is structural: AI amplifies visible output, while software organizations are wired to reward visible output.

Most engineering metrics were already biased toward what is easy to count. AI intensifies that bias because it produces countable artifacts at low cost: more code, more drafts, more test scaffolds, more pull requests, more documentation stubs, more issue comments.

None of those artifacts are the unit of value.

The unit of value is a completed change that solves a user or business problem with acceptable reliability, security, and maintenance cost.

That sounds obvious. Organizations still miss it because incentives sit one layer below strategy.

Engineers feel immediate relief when AI removes blank-page friction.

Managers see more motion in GitHub.

Executives want a clean ROI story.

Vendors offer adoption analytics because those are easy to surface.

So the organization starts measuring what became more abundant instead of what still remains scarce: understanding, judgment, integration quality, and organizational learning.

This is the same trap Charity Majors has warned about for years in observability: if you optimize for what your tooling can cheaply count, you will make systems worse while telling yourself a comforting story. The analogy holds here. AI makes coding more observable than engineering.

There is also a second structural reason: AI’s gains are uneven across the software lifecycle.

It helps most with code synthesis, boilerplate generation, test scaffolding, API exploration, documentation draft creation, and small refactors in familiar patterns.

It helps less with ambiguous product decisions, hard debugging in distributed systems, novel architecture, migration planning, dependency risk assessment, production forensics, and system-wide consistency.

This means AI creates asymmetric acceleration.

One slice of the workflow gets faster. The rest of the system often does not.

That matters because software delivery is a constrained flow system. If coding was not your main bottleneck, making coding faster does not materially improve end-to-end throughput. It may even worsen it by flooding downstream review, QA, and operational queues.

Linear’s product and engineering culture is instructive here. Linear has repeatedly emphasized small changes, strong defaults, opinionated scope control, and low coordination overhead as reasons it can move quickly. That is not an AI point on its face. It is an operating point: speed comes from reducing work-in-progress and decision friction, not just producing code faster. If AI increases work-in-progress without reducing coordination cost, you lose the very conditions that create flow.

There is a third reason this gets mismeasured: generated code creates hidden future liabilities that do not show up in the sprint where it was written.

These liabilities include:

  • Inconsistent patterns across the codebase
  • Weak domain modeling hidden behind plausible syntax
  • Inflated abstraction layers
  • Test suites that verify implementation details instead of behavior
  • Security issues from copied but not understood package usage
  • Review fatigue, where reviewers rubber-stamp because every diff is now larger

GitHub’s own research with Copilot has often highlighted perceived productivity gains, especially on narrower tasks. That is useful signal. But “perceived productivity” is not the same thing as net system productivity over a quarter. The moment generated code enters a shared codebase, the cost transfers from the individual to the team.

That transfer is why this becomes a leadership issue, not a developer preference issue.

The final reason measurement breaks is methodological.

Most teams do not have a baseline.

They deploy AI assistants broadly, then ask whether people “feel more productive.”

That approach fails for three reasons.

First, novelty bias is real. New tools feel good, especially when they remove friction in the first hour.

Second, task mix changes over time. If a quarter has more maintenance work than platform migration work, your “AI impact” signal is contaminated.

Third, local optimization confuses causality. If cycle time drops after introducing AI, was it the AI, a narrowed roadmap, fewer cross-team dependencies, a hiring freeze, stricter review policy, or all of the above?

The more senior the team and the more complex the codebase, the more this matters.

Again, the METR result is useful because it tested experienced developers in repositories they knew deeply. That setup strips away one easy explanation: “they were just learning the codebase.” In mature systems, speed is not constrained by typing. It is constrained by knowing what not to change.

That is exactly where naive AI productivity measurement breaks.

03 WHAT MOST GET WRONG

The most common mistake is treating AI tool adoption as proof of productivity improvement.

It is not.

A 75% weekly active rate in Cursor or Copilot tells you your developers are willing to try the tool. It does not tell you whether the organization is delivering more value, whether quality held constant, or whether senior engineers are absorbing more cleanup work.

The second mistake is using code volume as a proxy for productivity.

Lines of code were always a bad metric. In the LLM era, they become perverse. AI can generate large diffs cheaply. That can make less effective teams look more productive precisely because they are shipping more code than necessary.

Yuji Isobe’s framing on activity versus productivity is useful here: activity metrics such as commits, PRs, comments, or lines changed are easy to collect and easy to overvalue. They describe motion, not outcome.

The third mistake is measuring individual developer output instead of team system performance.

AI changes collaboration patterns. A senior engineer using AI to produce a large diff may appear highly productive individually while increasing the review burden on three other people. The local gain may be a net loss for the team.

This is why DORA metrics remain more robust than individual activity metrics. They force you back to flow and reliability.

The fourth mistake is ignoring understandability.

DX’s work on AI measurement points to a method that more teams should use: experience sampling at the point of work. For example, after a PR is submitted or reviewed, ask whether AI was used and whether the resulting code was easier or harder to understand. This matters because code comprehension is becoming the dominant cost center. If AI increases code volume but reduces readability, the team is borrowing speed from the future.

The fifth mistake is assuming faster task completion automatically means higher business productivity.

This is where teams repeat a classic local optimization failure.

A support engineer can answer tickets faster with macros and still worsen customer satisfaction.

A sales team can increase call volume and lower win rate.

A platform team can close more tickets and create more developer dependency.

Software is the same. If AI helps complete low-value tasks faster while starving architectural maintenance, your dashboard improves while your system degrades.

A real-world parallel comes from incidents caused by speed without sufficient verification. One famous example is Knight Capital’s 2012 deployment failure, which cost the firm more than $400 million in under an hour. That incident had nothing to do with AI, but it is exactly the kind of reminder engineering leaders need: faster change creation without commensurate controls can create catastrophic downside. The lesson is not “move slowly.” The lesson is “measure and govern the whole delivery system.”

There is another modern failure pattern worth naming: teams expand AI-generated test output and assume quality improved.

This fails because quantity of tests is not quality of tests.

Generated tests often overfit current implementation, miss critical edge cases, or duplicate low-value assertions. You end up with slower CI, more brittle test maintenance, and false confidence. If your quality dashboard says “test count up 40%” but your escaped defect rate is flat or worse, you did not improve productivity. You increased ceremony.

A sixth mistake is not segmenting by work type.

AI tends to produce very different outcomes across:

  • Greenfield application code
  • Legacy monolith changes
  • Infrastructure as code
  • Data pipelines
  • Mobile client code
  • Security-sensitive services
  • Internal tooling
  • Test generation
  • Documentation and runbooks

If you aggregate all of this into one productivity number, you lose decision usefulness. A CTO does not need one company-wide AI score. They need to know where AI helps enough to standardize and where it causes enough drag to constrain.

The seventh mistake is rolling out AI without changing review standards.

This is subtle and expensive.

When code generation gets easier, reviewers need stronger defaults on diff size, design explanation, provenance of generated code, and test expectations. If you keep old review norms while diff volume expands, review quality falls. Reviewers either slow the system down or start approving things they no longer fully understand.

GitHub Engineering, Stripe Engineering, and Cloudflare have all written in different contexts about the value of small, understandable changes and strong operational guardrails. The specific domains differ, but the operating principle is the same: if change volume rises, your control surfaces must improve too.

Most teams miss that.

They buy the tool.

They announce a policy.

They track adoption.

They call it a productivity program.

It is not. It is a code generation experiment with no valid measurement model.

04 THE FRAMEWORK

The approach that works is to measure AI across four layers: flow, quality, friction, and economics.

Not one layer.

All four.

Anything less creates false positives.

1. Start with a hard baseline before broad rollout

Do not roll AI tooling out org-wide and hope your quarterly metrics tell the story.

Create a four- to six-week pre-adoption baseline by team and by work type. Track:

  1. Lead time for changes
  2. Deployment frequency
  3. Change failure rate
  4. Time to restore service
  5. PR cycle time
  6. Median PR size in lines changed
  7. Review turnaround time
  8. Rework rate within 14 days of merge
  9. Escaped defect rate
  10. Developer-reported friction on key tasks

DORA’s four metrics are your anchor because they already connect to delivery performance. The additional metrics are there to explain movement inside the system.

Use medians, not averages, for most workflow metrics. A few giant migrations can distort averages beyond usefulness.

Segment by team and work category. At minimum:

  • Product feature work
  • Bug fixes
  • Refactors
  • Test writing
  • Documentation
  • Infrastructure/platform changes

If you do not segment, you will misread mixed effects as weak impact.

2. Measure end-to-end throughput, not coding speed

The key metric is not “time to first draft.”

It is “time from work start to safely running in production.”

That sounds obvious. It changes behavior immediately.

Track lead time by stage:

  • Ticket start to first PR
  • First PR to approval
  • Approval to merge
  • Merge to production
  • Production to confirmed outcome

If AI helps only the first stage while the others degrade, you have local acceleration and system slowdown.

This stage-based view is how mature teams spot where generated code shifts work rather than eliminating it.

For most B2B SaaS teams, a practical threshold is this: if AI-assisted changes reduce time-to-first-PR by 30% but increase review-plus-rework by more than 20%, you likely have no net gain. The exact number varies by architecture and release process, but the principle does not.

A faster draft is only useful if it survives review and production with low churn.

3. Add code health metrics that capture maintainability, not just defects

Quality is not just outage avoidance.

It is the future cost of change.

This is where most AI productivity programs stay shallow because maintainability is harder to observe than speed. You still need to observe it.

Track:

  • Reopen rate on AI-assisted tickets
  • PR comments per 100 lines changed
  • Post-merge reverts within 7 or 14 days
  • Hotfix ratio
  • Static analysis/security findings per merged change
  • Test flake rate introduced by change set
  • Module churn concentration over 30/60/90 days

These are not perfect metrics. They are useful because they catch common AI failure modes: verbose diffs, shallow understanding, brittle tests, and overconfident merges.

ISO 25010 is a helpful conceptual reference here because it frames software quality as including maintainability, reliability, security, and functional suitability—not just correctness. You do not need a formal ISO program to borrow that lens. You do need to stop pretending a merged PR is the end of the story.

4. Instrument developer friction at the point of work

This is the single most underused move.

Experience sampling beats retrospective opinion surveys for this problem.

DX has written about asking targeted questions right after a PR submission or review, such as:

  • Did you use AI on this task?
  • Did it help you complete the task faster?
  • Did it reduce or increase mental effort?
  • Was the generated code easier or harder to review?
  • Did you trust the output without significant edits?

This matters because AI changes cognitive load more than it changes visible workflow in some teams. A developer may finish a task in the same elapsed time but with less context switching and less fatigue. That is real value. Another may finish faster but leave behind code nobody wants to touch. That is negative value hidden under apparent speed.

Use these surveys sparingly and contextually. Two or three questions at a workflow trigger is enough. More than that and response quality collapses.

5. Tag AI-assisted work explicitly

If you cannot distinguish AI-assisted changes from non-AI changes, you cannot do causal analysis.

This does not require surveillance theater.

You do not need keystroke logging or developer ranking.

You need lightweight tagging.

Examples:

  • PR template checkbox: “AI used meaningfully in this change”
  • IDE/plugin metadata at aggregate team level
  • Commit trailer or label for AI-assisted draft generation
  • Review prompt asking whether AI increased or reduced understandability

The point is not compliance purity. The point is to create enough signal to compare cohorts over time.

If legal or privacy concerns block granular logging, team-level self-reporting is still better than no tagging. Perfection is not required. Directionally useful segmentation is.

6. Control diff size aggressively

This is where AI productivity programs become operational instead of rhetorical.

Large AI-generated diffs are review debt disguised as speed.

Set explicit thresholds.

A practical default for many SaaS teams is:

  • Under 300 changed lines: normal review
  • 300–800 changed lines: require stronger PR summary and test evidence
  • Over 800 changed lines: split unless it is generated code with isolated blast radius

These are not universal rules. They are useful forcing functions.

Stripe has long emphasized high-quality internal APIs, gradual rollout, and disciplined operational practices to manage complexity at scale. Even without a public “PR line limit” doctrine, the broader Stripe pattern is clear: complexity compounds unless you constrain it through interfaces and review discipline. AI increases the need for that discipline because it lowers the cost of producing accidental complexity.

If your team says, “Our codebase is too complex for small diffs,” that is not an argument against the threshold. It is evidence the threshold is needed.

7. Benchmark AI by task class, not by tool

Do not ask, “Should we standardize on Cursor or Copilot?”

Ask:

  • For test scaffolding in TypeScript services, which setup lowers lead time without increasing flaky tests?
  • For Terraform changes, does AI reduce authoring time while keeping policy violations flat?
  • For incident writeups and runbooks, does AI improve completeness and searchability?
  • For mobile code, does generated output increase review comments or crash regressions?

This yields decisions that survive beyond vendor cycles.

Vercel’s engineering culture has consistently favored tight feedback loops, strong defaults, and developer ergonomics that improve shipping velocity. That is a useful model here: evaluate AI where it shortens a specific feedback loop, not where it simply creates more output. Tool choice should follow the workflow bottleneck.

A vendor with weaker code generation but better team controls may produce higher net productivity than a stronger generator with poor observability and governance.

8. Track economic efficiency, not just engineering sentiment

Every AI productivity initiative eventually becomes a capital allocation decision.

You are paying for licenses, inference, security review, enablement time, and sometimes premium support or enterprise procurement overhead.

Measure:

  • Tool cost per active engineer per month
  • Estimated engineering hours saved on validated task classes
  • Review hours added
  • Incident or hotfix cost change
  • Reduction in outsourced or deferred work
  • Time-to-revenue impact for roadmap items

This does not need to be perfect finance-grade attribution.

It does need to be disciplined enough to compare options.

A practical way to do this is to estimate savings only where both conditions hold:

  1. A task class shows measurable cycle-time improvement
  2. Quality and rework remain flat or better

If only the first condition holds, do not book the savings.

This avoids one of the most common executive mistakes: counting speed gains that were simply displaced into review or cleanup.

9. Create policy by risk tier

The same AI policy should not govern a marketing microsite and an authentication service.

Set at least three tiers:

Tier 1: Low risk

Internal tools, documentation, test fixtures, support scripts.

Tier 2: Medium risk

Product features with bounded blast radius, standard services, analytics jobs.

Tier 3: High risk

Authentication, billing, permissions, security controls, core data systems, regulated workflows.

For each tier, define:

  • Allowed AI usage patterns
  • Required human review depth
  • Testing expectations
  • Logging/provenance requirements
  • Deployment and rollback requirements

Cloudflare’s engineering and operations writing is useful here because it consistently reflects blast-radius thinking. High-change systems can still move fast when changes are constrained by risk-aware guardrails. AI should fit into that same model.

Do not ban AI in high-risk areas categorically. Do require more explicit verification. The bottleneck in critical systems is trust, not draft speed.

10. Use a 90-day scorecard, not weekly snapshots

Weekly AI productivity dashboards are mostly noise.

Use a rolling 90-day view with monthly inspection.

Why 90 days?

Because AI effects often appear in sequence:

  • Immediate gain in drafting speed
  • Delayed increase in review burden
  • Later signal in rework, defects, and module churn

A 90-day window catches this shape.

Your scorecard should answer four questions:

  1. Did flow improve?
  2. Did quality hold or improve?
  3. Did cognitive/review friction decline?
  4. Did the economics justify the spend?

If the answer is not “yes” to at least three of the four, you do not yet have a proven productivity gain.

11. Keep one metric sacred: lead time with quality guardrails

If you need one executive metric, use this:

Median lead time for changes, segmented by work type, with change failure rate as the non-negotiable guardrail. This works because it captures both speed and system reality.

A drop in lead time with flat or improved change failure rate is strong evidence of real improvement.

A drop in lead time with worsening failure rate is borrowed speed.

A flat lead time with lower engineer cognitive load may still be worth it, but that is a different argument: sustainability and capacity, not throughput.

DORA gives you the outer frame. Experience sampling and rework metrics explain the inner mechanics.

You need both.

12. Study one system deeply before standardizing org-wide

Pick one team with:

  • Stable product area
  • Enough deployment frequency to generate signal
  • Low confounding from major architecture work
  • Willing staff engineer or engineering manager
  • Representative review process

Run a deliberate pilot for 8 to 12 weeks.

Document:

  • Which prompts or workflows actually worked
  • Which code areas generated cleanup burden
  • Which review heuristics improved outcomes
  • Which tasks should remain human-first

This is where practitioner insight comes from. Not broad rollouts. Not vendor demos. One controlled environment with real stakes.

Shopify has repeatedly shown a bias toward instrumented operational decisions in engineering, not broad process dogma for its own sake. That is the pattern to copy. Find your local truth with enough rigor that policy follows evidence.

05 STRATEGIC TAKEAWAY

AI coding productivity should be treated as a delivery systems investment, not a software seat license decision. If you measure the whole system, you will identify where AI genuinely compresses lead time—test scaffolding, internal tools, repetitive service code—and where it simply shifts work into review, rework, and operational risk. If you do not, you will likely make a Q3 budgeting decision based on adoption metrics, only to discover by Q4 that senior engineers became janitors for generated code and your change failure rate quietly worsened. That is the CTO decision in front of you this quarter: fund measured leverage, or subsidize unmeasured output.

06 IMPLEMENTATION ANGLE

Start with one pilot team, one baseline, and one dashboard that combines DORA metrics with AI-specific friction and rework signals. Use GitHub labels or PR template fields to tag AI-assisted work. Add two lightweight surveys at the point of PR creation and PR review. If you already use an engineering intelligence layer such as DX, Jellyfish, or Haystack, this is straightforward. If not, GitHub data plus a simple warehouse model is enough to begin.

Change your review protocol before you change your procurement footprint. Require tighter PR summaries for AI-assisted changes, explicit test evidence for medium- and high-risk services, and diff splitting above an agreed threshold. Train reviewers to ask one extra question: “Does this code fit our system, or is it merely plausible?” That question catches a large share of AI-generated waste.

If you find one or two task classes where AI clearly improves lead time without increasing rework, standardize those workflows aggressively. Write internal patterns, prompts, and examples. If your team is scaling and the constraint is engineering capacity rather than just tooling, this is also the point where Amplify-style support can help teams add execution bandwidth without dropping review standards. The key is sequence: first prove the workflow, then scale it.

07 FAQ

Q: What is the best way to measure developer productivity when AI writes code? A: The best method is to measure end-to-end delivery performance, not code output. Use DORA’s four metrics—lead time for changes, deployment frequency, change failure rate, and time to restore service—as the backbone, then add AI-specific signals such as PR rework, review burden, and point-of-work experience sampling. This approach aligns with Accelerate by Nicole Forsgren, Jez Humble, and Gene Kim, and avoids the trap of equating generated code with delivered value. Q: Are lines of code or pull request counts useful for measuring AI developer productivity? A: No. Lines of code and PR counts are activity metrics, and AI makes them easier to inflate without improving outcomes. Yuji Isobe’s writing on developer productivity in the LLM era makes this distinction clearly: high activity can coincide with low impact, especially when AI-generated code is later refactored or discarded. Q: Can AI coding tools make experienced developers slower instead of faster? A: Yes. METR reported in its 2025 study of experienced open-source developers that using early-2025 AI tools made participants take 19% longer on average in the repositories they knew well. The takeaway is not that AI is universally harmful; it is that measured real-world impact can diverge sharply from self-reported productivity gains, especially in complex codebases. Q: What metrics should a CTO track to evaluate AI coding ROI? A: A CTO should track median lead time for changes, change failure rate, review turnaround time, post-merge rework within 7 to 14 days, escaped defects, and tool cost per active engineer. Add AI-assisted work tagging so these metrics can be compared against non-AI work. The investment only pays off when cycle time improves and quality remains flat or better; otherwise the savings are illusory. Q: How should teams govern AI-generated code in high-risk systems? A: Use risk tiers. For low-risk work such as internal tools or documentation, allow broad AI assistance; for high-risk areas such as authentication, billing, permissions, and regulated workflows, require deeper human review, stronger test evidence, and explicit rollback plans. This mirrors the blast-radius thinking used by operators like Cloudflare and the reliability-first principles in the Google SRE Book.

Enjoyed this article?

Share it with your network

LatAm Engineering Insights

Stay ahead of the curve

Weekly insights on hiring LatAm developers, salary trends, tech stack analysis, and exclusive job opportunities.

No spam, unsubscribe anytime. We respect your privacy.

Salary Insights

Real market data on LatAm developer salaries

Hiring Tips

Best practices for remote LatAm teams

Exclusive Roles

Early access to new job opportunities

Join 2,500+ CTOs, Engineering Managers, and Developers