3

Consider the following scenario.

You currently have a feature set A you wish to extend to include feature set B. In the near feature there's a high possibility that you wish to extend this even further to include feature set C.

  • Option 1) Cost to extend A -> B is minimal, but high maintenance costs.
  • Option 2) Cost to refactor A and B to make more logical sense is moderate, but low maintenance costs.

Extending to include feature set C:

  • Cost to extend refactored(A & B) -> C is minimal, again low maintenance costs.
  • Cost to extend A,B -> C is high, (both to refactor and extend).

Assuming the inclusion of feature set C is beyond the scope of the current sprint, how do you go about choosing an option?

How does this change if the addition of feature set C is several (2 or more) sprints out?

James
  • 583
  • 2
  • 13
  • 1
    The obvious course of action is to refactor first. The only reason that doesn't *always* occur is time constraints. – Robert Harvey Apr 03 '13 at 19:57
  • 2
    As others pointed out, it is better to refactor as soon as possible because refactoring becomes more expensive later. Another measure is to design your components as small and independent from each other as possible, to minimize refactoring. Some consider excessive need for refactoring an indication of poor design (see e.g. the last paragraphs of http://www.techrepublic.com/blog/programming-and-development/static-vs-dynamic-languages-why-choose-one-over-the-other/4577). This is not necessarily the case in your situation, but it can be worth checking it. – Giorgio Apr 03 '13 at 20:11
  • possible duplicate of [Agile estimation with tech-debt](http://programmers.stackexchange.com/questions/149539/agile-estimation-with-tech-debt) and of [Rule of thumb for cost vs. savings for code re-use](http://programmers.stackexchange.com/questions/127118/rule-of-thumb-for-cost-vs-savings-for-code-re-use) – gnat Apr 03 '13 at 21:42

1 Answers1

5

The longer you keep the debt the higher the accumulated interest. It's almost always better to pay off now.

EricSchaefer
  • 2,091
  • 1
  • 17
  • 30