Technical Debt
This wonderful metaphor by Ward Cunningham reminds us that doing things in a “quick and dirty” manner or taking shortcuts sets us for a debt which, when not repaid promptly, incurs interest in the future.
When developing systems, enhancing existing ones, or even fixing bugs, we will typically arrive at a crossroad: should we take the time to do it right; or should we take shortcuts and deliver quickly?
It is generally in the interest of the business folks to roll out changes quickly; while the development folks would choose to properly design, implement and test changes before delivery.
Fortunately, It doesn’t apply to everything (e.g. code smells or design flaw).
It requires a deliberated decision to do something that is not sustainable in the long-term, but yields a short-term benefit. The result of which is not in the interest of the system's ongoing maintainability.
The recommendation is that:
However, the recommended 3-pronged approach is:
A more practical approach is to always reserve time to repay debts while continuing with business-as-usual (enhancements, bug-fixing, etc.).
When developing systems, enhancing existing ones, or even fixing bugs, we will typically arrive at a crossroad: should we take the time to do it right; or should we take shortcuts and deliver quickly?
It is generally in the interest of the business folks to roll out changes quickly; while the development folks would choose to properly design, implement and test changes before delivery.
Fortunately, It doesn’t apply to everything (e.g. code smells or design flaw).
It requires a deliberated decision to do something that is not sustainable in the long-term, but yields a short-term benefit. The result of which is not in the interest of the system's ongoing maintainability.
Examples of technical debt
Some common examples include:- hardcoding values in source code
- postponement of documentation
- postponement of writing tests
- overusing TODO comments
- ignoring compilation (e.g. deprecation) or code analysis warnings
- not merging code in source code management
Issues with technical debt
How does a technical debt haunt us? The following could be signs of debt (or interest, in financial terms):- instability in the system
- increase maintenance costs
- feeble architecture affecting extensibility
- patching data takes up most of the time
Should one ever incur a technical debt?
Indeed, there is no right or wrong!The recommendation is that:
- if the system is reasonably stable, incurring a technical debt is fine. However, this needs to be repaid promptly.
- if the system is nowhere stable, do not incur further debts. The reason for the current state may well be due to a technical debt!?
How does one pay down the debt?
A common excuse to paying down technical debt is "if it ain't broken; don't fix it".However, the recommended 3-pronged approach is:
- Track down the technical debt
- Stop incurring debt
- Start repayment
- go back to make changes one would have done if time and resources had permitted
- tune the system (oil the machinery!)
- database tuning is the most common (e.g. archiving, indexing, implement partitioning, etc.)
- review configurable parameters (maximum requests, timeout, etc.)
A more practical approach is to always reserve time to repay debts while continuing with business-as-usual (enhancements, bug-fixing, etc.).
Comments