# Technical Debt Quick Reference

## Debt Metaphor

| Term | Meaning |
|------|---------|
| Principal | One-time cost to fix the design |
| Interest | Extra cost per change that touches the debt |

## Fowler's Quadrant

| | Reckless | Prudent |
|--|----------|---------|
| **Deliberate** | Knew, cut corners, no plan to fix | Knew, planned to pay back |
| **Inadvertent** | Didn't know, made a mess | Learned; design should change |

Prudent deliberate = acceptable. Reckless deliberate = toxic.

## Identifying Debt

| Signal | What to Look For |
|--------|------------------|
| Code smells | Long functions, duplication, deep nesting, God classes |
| Velocity | Same features taking longer, points per sprint dropping |
| Bugs | Same module failing repeatedly |

## Metrics

| Metric | Use |
|--------|-----|
| Cyclomatic complexity | Per-function complexity |
| Test coverage | Gaps = risky areas |
| Lead time / cycle time | Idea → ship |
| Bug rate by module | Where debt hurts most |
| Churn | Files changed often = high interest |

## Prioritization

1. **Interest** — High-touch debt first
2. **Principal** — Can we pay in one sprint?
3. **Risk** — Security, outages
4. **Strategy** — Are we changing this area soon?

## Communicating

| Do | Don't |
|----|-------|
| Quantify impact (time, bugs, risk) | Use jargon (complexity, smells) |
| Tie to business goals | Say "code is messy" |
| Offer options and tradeoffs | Demand without context |

## Strategies

| Strategy | When |
|----------|------|
| Boy Scout Rule | Incremental; leave code better |
| Dedicated sprints | Allocate % capacity |
| Strangler Fig | Legacy; replace gradually |
| Refactor | Design salvageable |
| Rewrite | Design fundamentally wrong; rare |
