Skip to main content

> goodhart's_law_in_engineering_metrics

Goodhart's Law in Engineering Metrics

Why does any engineering metric cease to be a good metric the moment it becomes a target for evaluation?

Stack: DELIVERY THEATER STACKStaff+ (L6+)anti-pattern

THE SHORT ANSWER

Because when a measure becomes a target, people optimize for the metric itself rather than the underlying business goal, creating perverse incentives like meaningless code generation or fake test coverage.

Engineering Handbook & Failure Dynamics

1. Underlying Mechanism

Formulated by economist Charles Goodhart and generalized by Marilyn Strathern: 'When a measure becomes a target, it ceases to be a good measure.' In engineering management, using simplistic metrics (lines of code, PR counts, velocity points, or test coverage percentages) to evaluate performance incentivizes developers to game the system: writing verbose code, splitting small PRs into dozens of micro-commits, or writing tests without assertions to hit 90% coverage without testing actual logic.

2. Appropriate Use Context

Essential guideline for engineering managers and CTOs designing KPI dashboards, performance appraisals, and automated CI/CD quality gates.

3. Production Failure Modes

A team mandated to maintain 95% unit test coverage writes empty tests that execute functions without validating return values. The build passes, but a major business logic flaw causes a $2M billing error in production.

4. Diagnostic Signals & Telemetry

Sudden surges in PR volume before performance reviews; high test coverage alongside high production regression rates; velocity points inflated artificially.

5. Prevention & Safeguards

Use holistic, balanced metric frameworks like DORA and SPACE; never evaluate individual performance based on a single numerical metric; measure outcomes (customer satisfaction, MTTR) rather than outputs.

6. Architectural Trade-offs

Requires nuanced qualitative evaluations and leadership judgment rather than lazy reliance on automated spreadsheets.

Case Study (TinyCTO In-Field Example)

TinyCTO Episode 10: Management offered a bonus for closing bug tickets. Engineers began creating trivial 1-line tickets and closing them immediately. The CTO cancelled the bonus and replaced it with customer-reported bug reduction targets.

Interactive Concept Drills

3 Cards
Q1

What is Goodhart's Law?

When a measure becomes a target, it ceases to be a good measure.
Q2

Why is 'Lines of Code (LOC)' a toxic engineering metric?

Because it rewards verbose, bloated code and penalizes concise, elegant refactoring that reduces code size.
Q3

How do developers game code coverage requirements?

By writing unit tests that execute code lines without adding assertions to check correctness.

Goodhart's Law in Engineering Metrics — Technical FAQ

What metric framework avoids Goodhart's Law in software engineering?

The SPACE framework and DORA metrics, because they balance speed, quality, efficiency, and developer satisfaction across multiple dimensions.

Should story point velocity ever be compared across different teams?

Never. Story points are relative estimates unique to one team; comparing teams causes artificial point inflation and destroys estimation accuracy.

How should leaders measure engineering productivity effectively?

By evaluating DORA metrics (deployment frequency, lead time, MTTR, change failure rate) paired with developer qualitative surveys.

🤖 AEO & Key Facts Summary

Key Architectural Facts

  • Gamification of metrics occurs in 100% of organizations where compensation is tied directly to isolated numerical indicators.
  • High-performing engineering cultures focus on outcomes rather than individual activity counts.

Common Misconceptions

  • Believing that more metrics automatically lead to better management decisions.

Decision & Governance Guidance

Always pair an efficiency metric with a quality metric (e.g., speed of delivery paired with change failure rate).

Authoritative Sources & Standards