Should You Put Story Points on Code Refactoring Tasks?

ScrumPoi · · 11 min read

Should You Put Story Points on Code Refactoring Tasks?

Stop Pointing Refactoring Work. Start Managing It Like an Adult.

If your team is arguing about whether to put story points on refactoring tasks, you don’t have an estimation problem. You have a product and engineering maturity problem.

Here’s the uncomfortable truth:
Most teams either:

  • Hide refactoring inside feature stories (and then wonder why nothing gets done), or
  • Create giant “refactor the world” tickets with 13 points and no clear outcome.

Both approaches are broken.

Let’s unpack when (and if) you should put story points on refactoring, how to avoid gaming your velocity, and what to do instead if you want sustainable delivery without turning your backlog into a graveyard of “tech debt” tickets.


What Are We Really Asking When We Ask About Points?

Before we get dogmatic, clarify what you’re actually trying to solve.

The Real Questions Behind “Should We Point Refactoring?”

When teams debate points on refactoring, they’re usually wrestling with one or more of these:

  • “How do we make time for refactoring?”
    Translation: “Product never prioritizes tech work unless it has points.”

  • “How do we track effort and capacity?”
    Translation: “We’re under pressure to justify why we’re not shipping more features.”

  • “How do we keep velocity meaningful?”
    Translation: “We don’t want to inflate numbers with internal work.”

These are legitimate concerns. But story points are a terrible place to solve political and organizational problems.

Two Types of Refactoring (Don’t Mix Them Up)

You can’t answer the points question until you distinguish between:

  1. Opportunistic refactoring

    • Small, local improvements done while working on a feature or bug
    • Example: Extracting a method, renaming variables, simplifying a function
    • Typically minutes to a couple of hours
  2. Strategic refactoring / re-architecture

    • Larger, planned work with clear scope and risk
    • Example: Extracting a service, modularizing a monolith, replacing a legacy library
    • Typically days to weeks

Treating these the same in your backlog or estimation process guarantees confusion.


Should You Put Story Points on Refactoring? The Opinionated Answer

Here’s the stance that works in real teams under real pressure:

  • Do NOT point opportunistic refactoring separately.
  • DO point strategic refactoring as first-class backlog items.

Let’s break that down.

1. Don’t Put Points on Opportunistic Refactoring

If you’re refactoring as part of doing a feature, it’s part of the feature. Period.

When a team estimates a story, they should be implicitly including:

  • Implementation
  • Tests
  • Necessary refactoring to keep the codebase healthy

If they’re not, you don’t have an estimation problem, you have a definition-of-done problem.

Why you shouldn’t point these separately:

  • You’ll double count effort.
    The feature story gets 5 points, the “refactor for that feature” gets 3 points. Velocity goes up, value delivered does not.

  • You incentivize bad behavior.
    Developers can slice everything into “feature” and “refactor” to pad numbers.

  • You create pointless admin overhead.
    Micro-tickets for every rename and extraction? No thanks.

Instead:
Make it explicit that “responsible refactoring” is part of every story. If a story seems too big because of required cleanup, re-estimate the story as a whole.

2. Do Put Points on Strategic Refactoring

Larger refactorings are real work with real risk and trade-offs. They compete with features. They deserve:

  • Clear outcomes
  • Acceptance criteria
  • Business rationale
  • Story points (or whatever estimation unit you use)

Example of a valid pointed refactoring story:

“Split the payment module into separate checkout and billing services so we can deploy billing changes independently and reduce average release rollback incidents from 3 per quarter to 1.”

Estimate that. Plan it. Track it. Treat it like any other backlog item.

Rule of thumb:
If it’s big enough to:

  • Span multiple days
  • Require coordination
  • Have meaningful risk if delayed or skipped

…then it’s big enough to be its own story and carry points.


The Hidden Cost of Ignoring Refactoring

Teams that never explicitly plan refactoring pay for it in other ways.

The Productivity Cliff (And Why It’s Your Fault)

A 2018 study by Codacy reported that teams with high unmanaged technical debt saw up to 40% slower delivery over 2 years compared to similar teams that actively managed refactoring and quality work.

You don’t feel this in a week. You feel it when:

  • A “simple change” takes 3 days because nobody understands the module
  • You need 2–3 devs to review every change because the code is fragile
  • Bug fixing sprints become a recurring thing, not an exception

When you refuse to schedule strategic refactoring, you’re effectively saying:

“We’re okay paying 30–40% more for every feature 12–18 months from now.”

That’s not frugal. That’s deferred pain.

Refactoring as Risk Management, Not Aesthetic Cleanup

Non-technical stakeholders often hear “refactoring” and think “developers rearranging code to feel good.”

Reframe it:

  • Reduce incident risk – smaller, clearer modules fail less catastrophically
  • Reduce cycle time – easier to change, easier to test
  • Reduce onboarding time – new devs ramp up faster

If your refactoring story doesn’t tie to one of these, it’s probably not strategic enough to be its own item.


Common Mistakes When Estimating Refactoring (What Not to Do)

Let’s call out the patterns that consistently wreck teams.

Mistake 1: The “Tech Debt Bucket” Story

You’ve seen this one:

“Handle tech debt – 8 points”

This is a dumpster, not a backlog item.

Why it’s harmful:

  • No clear outcome
  • No way to know if it’s done
  • Impossible to prioritize against real features

Fix it:
Break it into specific, outcome-oriented stories:

  • “Replace legacy HTTP client in user service to remove security vulnerabilities and reduce maintenance cost.”
  • “Introduce integration tests for checkout flow to reduce production payment failures.”

Mistake 2: Estimating Refactoring in Isolation From Value

Refactoring effort without context is useless.

Bad:

“Refactor order service – 5 points.”

Better:

“Refactor order service to support multi-currency pricing and reduce regression risk when adding new currencies – 5 points.”

If you can’t articulate the value or risk reduction, don’t estimate it yet. Refine it first.

Mistake 3: Hiding Massive Refactors Inside “Feature” Stories

This is where your 3-point story mysteriously takes 3 sprints.

Example:

  • Story: “Add discount codes to checkout – 3 points.”
  • Reality: Requires ripping apart a 5,000-line checkout class and building a new pricing engine.

You tried to sneak in a strategic refactor as “just part of the feature,” and now:

  • Estimates look wildly off
  • Trust in the team’s planning drops
  • Everyone is frustrated

Fix it:
Split it:

  • Story A: “Refactor pricing logic into a separate component that supports pluggable discount rules – 5 points.”
  • Story B: “Implement discount codes using new pricing component – 3 points.”

Now you can:

  • Decide if the refactor is worth doing now
  • Communicate risk and trade-offs
  • Track progress honestly

Mistake 4: Using Points to Justify Refactoring to Management

If your only argument for refactoring is “it’s 13 points,” you’ve already lost.

Stakeholders don’t care about points. They care about:

  • Delivery speed
  • Incident frequency
  • Cost of delay
  • Ability to ship key roadmap items

Use these, not points, to justify strategic refactoring.


How to Handle Refactoring in Your Process (Step by Step)

Here’s a practical approach you can implement without rewriting your entire process.

1. Update Your Definition of Done

Make refactoring part of normal work by updating your Definition of Done (DoD):

Include statements like:

  • “Code is left cleaner than we found it (naming, duplication, complexity).”
  • “New or changed code has appropriate tests.”
  • “No increase in known technical debt without explicit discussion.”

This signals:

  • You’re expected to do opportunistic refactoring
  • You don’t need separate tickets for every small improvement

2. Add a Simple Refactoring Triage Practice

During backlog refinement, add a quick triage step:

For each story, ask:

  • “Is there refactoring we must do to safely deliver this?”
  • “Is that refactoring small (within the story) or large (needs its own story)?”

If large:

  • Create a separate refactoring story
  • Tie it explicitly to the feature or risk it supports
  • Estimate it like any other story

3. Make Refactoring Value-Focused

When you create a refactoring story, always include:

  • Business or risk outcome – What gets better?
  • Scope boundaries – What will we not refactor?
  • Measurable signal – How will we know it helped? (Even a rough proxy is fine.)

Example:

“Refactor notification system to support multiple channels (email, SMS, push) so we can add SMS notifications without duplicating logic. Done when:

  • Channels are pluggable
  • Existing email notifications still function
  • Adding SMS is a configuration change, not a code fork.”

4. Set a Target Capacity Allocation for Tech Work

Don’t rely on “we’ll squeeze in refactoring when we have time.” You won’t.

Instead, agree on a capacity allocation guideline, for example:

  • 70–80%: Feature work
  • 20–30%: Tech debt, refactoring, internal quality

Then:

  • Track it explicitly per sprint
  • Adjust based on reality (e.g., after incidents, increase refactoring temporarily)
  • Make the trade-offs visible to stakeholders

This is how high-performing teams avoid the slow death of unmanaged tech debt.

5. Use Story Points for Forecasting, Not Accounting

Stop treating story points like currency you must allocate perfectly.

Use them to:

  • Forecast roughly how much work fits in a sprint
  • Compare relative size and risk of items
  • See trends in delivery capacity over time

Do not use them to:

  • Prove individual productivity
  • “Pay for” refactoring
  • Justify headcount

If refactoring is strategic work in your backlog, it gets points like anything else. If it’s opportunistic cleanup, it’s part of the feature story. Simple.


Practical Examples: How This Looks in Real Backlogs

Let’s ground this with a few before/after examples.

Example 1: Small Cleanup While Adding a Feature

Before:

  • Story: “Add ‘remember me’ checkbox to login – 3 points.”
  • Separate task: “Refactor login form validation – 2 points.”

After:

  • Single story: “Improve login UX with ‘remember me’ and simplified validation – 3 points.”
  • Included in estimate: small refactor to validation logic

No separate refactoring ticket. No extra points.

Example 2: Medium Refactor Enabling a Roadmap Item

Before:

  • Story: “Support multiple payment providers – 5 points.”
  • Hidden reality: payment code is hard-wired to a single provider.

After:

  • Story A: “Refactor payment gateway to support pluggable providers – 5 points.”
  • Story B: “Integrate Provider B using new gateway – 3 points.”

Both stories get points. Both are visible. Stakeholders can decide sequencing.

Example 3: Strategic Refactor to Reduce Incidents

Before:

  • Recurring incidents in order processing
  • Vague tech debt story: “Refactor order pipeline – 8 points.”

After:

  • Story: “Refactor order pipeline to isolate payment failures and reduce rollback incidents from ~4 per quarter to ≤1.”
  • Acceptance:
    • Payment failures don’t block inventory updates
    • New integration tests cover happy path and common failure modes

Now the refactoring has a clear business rationale and can be prioritized.


Tools That Help You Have Better Conversations About Refactoring

You don’t need a special “refactoring tool.” You need tools that:

  • Make estimation collaborative and unbiased
  • Keep technical and business work in the same backlog
  • Support quick, low-friction sessions for planning and retrospectives

For example, teams use tools like ScrumPoi (a free planning poker and retrospective tool with anonymous voting and Jira integration) to estimate both feature and refactoring stories together, without anchoring or side conversations dominating.


So… Should You Put Story Points on Refactoring Tasks?

Here’s the distilled answer:

  • Yes, for strategic refactoring that:

    • Has clear outcomes
    • Competes with features
    • Spans more than a few hours
    • Reduces meaningful risk or enables roadmap items
  • No, for opportunistic refactoring that:

    • Is part of doing a feature well
    • Fits within the original story
    • Is covered by your Definition of Done

If your team is still stuck in philosophical debates about “pure” velocity and whether refactoring “deserves” points, you’re looking at the wrong problem.

The real work is:

  • Making refactoring a normal part of delivery
  • Being honest about large technical work and its trade-offs
  • Using points to forecast, not to win political battles

Handle that, and the question “Should we put story points on refactoring?” mostly answers itself.

Keep reading

More on the topics this article touches.