How to Estimate Technical Debt and Refactoring Work in Planning Poker

A four-step routine to turn a vague debt card into work your whole team can size and vote on fairly.

Estimation Cleiton Loiola · · 7 min read

You've probably got a card like this in your backlog. Someone wrote "Clean up the billing module" a few sprints ago. It comes up in refinement, an engineer says it's getting worse, everyone nods, and the team moves on to the next feature. Nobody votes on it, because nobody can say what it's worth or when it would be finished.

When you estimate technical debt, planning poker gives you the vote, and that's the easy part. The hard part happens before anyone picks a card, when you turn a vague worry into something the whole team can size. That takes four steps: say the debt as one sentence of risk or cost, agree what done looks like, compare it with a reference story, then vote and let the spread show you what's still fuzzy.

Why debt and refactoring work gets skipped in planning

Debt items lose to feature stories because they're hard to describe in terms anyone outside the code cares about. A feature has users who'll notice when it ships. Refactoring has no user-visible outcome, so when the product owner orders the backlog, the debt card has nothing to point at except an engineer's unease.

The process around it adds friction too. Matthias Noback describes what happens to debt work during the sprint: "Yet, the scrum process prescribes that no work be done in the sprint that is not on the board. So an issue has to be created, and we jump back into the project management waterfall." One workaround he lists is a catch-all ticket: "They can commit their changes to a dedicated Technical Debt ticket (but the issue itself is quite meaningless)." And about the vote itself, he writes: "This magic number has no specific meaning."

When raising a small piece of debt means a new ticket and a long discussion, engineers tend to stop raising it. The debt that does get written down often ends up on a card with no stated risk and no finish line. A product owner can't weigh that against a feature, and engineers can't vote fairly when each of them pictures a different job.

Before your next refinement, ask the team one question: which debt item have we mentioned in the last three refinements and never sized? Write the answer at the top of the story list. That's your first card for this routine.

Steps 1 and 2: Say the debt in one sentence and agree what done looks like

A debt card is ready to vote on when anyone in the room can say what it protects you from and what finished looks like. You get there with two short pieces of writing.

Step 1: Write the risk sentence

Use this template: "If we don't fix X, then Y happens." X is the specific thing in the code. Y is the risk or cost that the team, or the product, keeps paying while X stays.

Take the vague card from earlier. "Clean up the billing module" names a place in the code and nothing else. A risk sentence might read: "If we don't separate invoice calculation from the rest of the billing module, every pricing change risks breaking invoices we didn't touch."

Now the product owner has something to weigh. They can compare that risk with the next feature on the list and decide where the card belongs. For the engineers, the sentence shows whether they agree on the problem before anyone talks about size.

If you can't finish the sentence, you've learned something too. Maybe the debt is a feeling and nobody has looked closely yet. In that case, investigate first, because it's too early to estimate.

Step 2: Write the done definition

Debt work tends to grow, because there's always one more thing to tidy. A done definition gives it an edge. Write two or three lines that anyone could check, such as which tests pass or which module no longer has the problem.

For the billing card, it could look like this:

  • Invoice calculation lives in its own module, with its own tests.
  • The existing billing tests pass without changes.
  • The old calculation code in the billing module is deleted.

If the team can't agree on those lines, the item isn't ready to vote on. Have that conversation first, since a vote where half the room pictures a two-line fix and the other half pictures a rewrite only produces noise.

Disagreement about done often hides disagreement about quality itself. A quick way to surface it is to ask everyone to rate the code in question from 1 to 5 before you discuss it. Henrik Kniberg writes about code-quality ratings: "If you see great variation, like some 5s and some 1s, then you need to explore this." He says, "If opinions vary strongly then you need to have a discussion about what you mean by quality, and where you want to be as a team."

Step 3: Compare with a reference story

Relative sizing is what lets a debt card and a feature story share one backlog and one scale. You aren't asking "how many points is a refactoring?" You're asking whether this card is bigger or smaller than a piece of work the team has already sized. If your team still thinks in days, start with how to explain relative estimation before you try it on debt.

Pick one reference story that involved similar code or test work. For the billing card, that might be an earlier story where the team moved logic between modules and updated the tests around it. Put it at the top of the story list for the session so nobody has to remember it mid-round. A 5 then means "about as much work as that story", and everyone can see which story that is.

Debt cards often land at the top of the deck, because untangling old code touches more than anyone expects. Martin Fowler writes that the top number in a point series often means a story is too big, and that it's usually better to say a story is too big to estimate than to use a false marker number.

Treat a top-of-deck vote on a debt item as a signal to split it. But don't guess a number. Look back at your done definition, because each line is often a candidate for its own card. For billing, extracting the calculation could be one card and deleting the old code another.

If the item won't split cleanly yet, there's more on when to split or park a story that's too big in an earlier post. Those rules work for debt too.

Step 4: Vote, read the spread and hear the outliers

Debt cards are where the loudest voice does the most damage. The person who raised the debt often has the strongest opinion, and if they speak first, everyone else anchors on their number. Vote in secret and reveal together, so each person's read of the work counts the same.

For the round itself, you can use TinyTroop, free online planning poker where votes stay secret until the reveal. The reveal shows the average, the median and the spread, and when the votes split, the tool names the outlier votes so you know whom to hear first.

A wide spread on a debt card usually points back to steps 1 and 2. Either the risk sentence means different things to different people, or the done definition leaves room for two very different jobs.

Say the card is "Upgrade the test framework" and the reveal shows a 3 and a 13. Ask each person to name the assumption behind their number. Whoever voted 3 might be picturing a version bump and a config change, while the 13 might know that the old test setup code will need rewriting.

They're sizing different jobs, so fix the card before you vote again. Add the missing assumption to the done definition, or split the setup rewrite into its own item, then re-vote once. If it still splits, the card needs more work outside the session, and you can bring it back next time.

Keep discussion for contrasting views. When the cards cluster, take the number and move on, because a debt card doesn't need more talk than a feature just because it's technical. When one or two votes sit far from the rest, there's a fuller guide to hearing the outliers when a debt item gets a 3 and a 13.

The product owner's part in this step is to clarify value, and they don't vote. When the team asks whether that risk is worth paying down this sprint, the product owner answers and the engineers size the work. Keeping those two jobs apart stops the estimate from turning into a priority argument.

Keep debt visible after the vote

A sized debt card can still disappear. It's easy to vote a 5, nod, and watch the card sink below every new feature for months. Sizing makes debt comparable with feature work, but you still need a rule for when it gets done.

Mountain Goat Software says, "Teams often struggle to fit refactoring or other technical cleanup into their sprints." It also says that convincing a product owner that debt should be paid off is part of the challenge. One approach it suggests is to allocate a fixed amount of time to refactoring in each iteration. Another is to write a backlog item for repaying the debt at the moment the team takes it on, and put that item in the product backlog.

Both approaches work better once your debt cards carry a size. With a fixed allocation, you know how many sized debt cards fit in a sprint. A repayment item with a risk sentence and a size gives the product owner what they need to order it against features.

Whichever you choose, keep sized debt items in the same backlog as features, so they compete on the same terms. Then review skipped debt at each refinement. Any debt card that's been passed over twice gets a fresh look at its risk sentence: if the risk has grown, it moves up, and if it's shrunk, you can drop it. A refinement meeting that ends on time leaves room for that check.

I'd pick one approach for the next sprint and put it on the retro agenda, so the team judges it on what happened.

A debt card gets a fair vote when it names the risk, says what done looks like, and gets sized against work the team already knows. Write one of those cards this week and bring it to your next round.

Want to see whose card flips to a 13? Start a free room, share the link, and let the team vote.