DEV Community

Discussion on: How do you sell refactoring to your team?

Collapse
 
3leftturns profile image
Andrew T Johnson

I start with myself. I refactor and clean code I own and take responsibility and initiative. But if a project smells bad and I know I’ll need more sprint time to tidy up, I present a value versus risk plan to my tech lead. We decide if it’s doable now, and if not we put a ticket in the backlog to pull in the next time that project gets touched. When we plan sprints it’s always driven by business need, but a little extra time can be allotted to pull in these refactoring tickets.

As for selling refactoring to the team, if your culture promotes direct ownership of the code by everyone, then your colleagues will want to refactor to clean code to lower their time spent on bugs. +1 for testing here too.