A common practice in Scrum teams is to tackle technical debt work as soon as it is discovered and to wrap the work in to the story in which the technical debt was identified.
There are two reasons for doing this:
- It is usually easier to work on the technical debt as close as possible to when it was discovered. The team members are typically in the code and so can efficiently complete the work.
- Delaying technical debt risks giving a false impression of progress. For example, the team shows 5 stories done in a sprint, but in reality there is technical debt accumulated that still needs to be resolved.
Technical debt that is not associated with a specific story can be added to the backlog.
The technical debt work will be evaluated alongside all the other backlog items. For this reason it is important to identify the value of the technical debt work. For example:
If this technical debt is not completed it will be more difficult to work on the code base and so the team's productivity will be reduced.
You may also wish to consider wrapping technical debt on the backlog in to other backlog stories. For example, a team realises that the site home page is using a deprecated version of a library. They add this technical debt to a functional story that touches on the home page, so that the debt work will be fixed at the same time as the functional work.