Technical debt (also known as design debt or code debt) is "a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution".
Some[who?] believe that, analogous to monetary debt, that if technical debt is not repaid, then it will keep on accumulating 'interest', making it harder to implement changes later on. Unaddressed technical debt increases software entropy. Technical debt is not necessarily a bad thing, and sometimes[when?] technical debt is required to move projects forward. On the other hand, some experts claim that the "technical debt" metaphor tends to minimize the impact, which results in insufficient prioritization of the necessary work to correct it.
As a change is started on a codebase, there is often the need to make other coordinated changes at the same time in other parts of the codebase or documentation. The other required, but uncompleted changes, are considered debt that must be paid at some point in the future. Just like financial debt, these uncompleted changes incur interest on top of interest, making it cumbersome to build a project. Although the term is used in software development primarily, it can also be applied to other professions.
|This section does not cite any sources. (May 2016) (Learn how and when to remove this template message)|
Common causes of technical debt include (a combination of):
- Business pressures, where the business considers getting something released sooner before all of the necessary changes are complete, builds up technical debt comprising those uncompleted changes.
- Lack of process or understanding, where businesses are blind to the concept of technical debt, and make decisions without considering the implications.
- Lack of building loosely coupled components, where functions are not modular, the software is not flexible enough to adapt to changes in business needs.
- Lack of a test suite, which encourages quick and risky band-aids to fix bugs.
- Lack of documentation, where code is created without necessary supporting documentation. That work to create the supporting documentation represents a debt that must be paid.
- Lack of collaboration, where knowledge isn't shared around the organization and business efficiency suffers, or junior developers are not properly mentored.
- Parallel development at the same time on two or more branches can cause the buildup of technical debt because of the work that will eventually be required to merge the changes into a single source base. The more changes that are done in isolation, the more debt that is piled up.
- Delayed refactoring – As the requirements for a project evolve, it may become clear that parts of the code have become unwieldy and must be refactored in order to support future requirements. The longer that refactoring is delayed, and the more code is written to use the current form, the more debt that piles up that must be paid at the time the refactoring is finally done.
- Lack of alignment to standards, where industry standard features, frameworks, technologies are ignored. Eventually, integration with standards will come, doing sooner will cost less (similar to 'delayed refactoring').
- Lack of knowledge, when the developer simply doesn't know how to write elegant code.
- Lack of ownership, when outsourced software efforts result in in-house engineering being required to refactor or rewrite outsourced code.
- Poor technological leadership where poorly thought out commands handed down the chain of command increases the technical debt rather than reduce it
- Last minute specification changes; these have potential to percolate throughout a project but no time or budget to see them through with documentation and checks
- Scope Doping, unmanaged scope reduction or shedding of scope by project managers, or indeed technical staff. Subtly different to Business pressures in that, while business pressures may be a cause, Scope Doping will also cause business pressure due to unmanaged work scope that has been shed.
It is useful to differentiate between types of technical debt. In a discussion blog "TechnicalDebtQuadrant.", Fowler distinguishes four debt type "quadrants" based on two dichotomous categories: the first category is reckless vs prudent, the second, deliberate vs inadvertent
"Interest payments" are both in the necessary local maintenance and the absence of maintenance by other users of the project. Ongoing development in the upstream project can increase the cost of "paying off the debt" in the future.[clarification needed] One pays off the debt by simply completing the uncompleted work.
The buildup of technical debt is a major cause for projects to miss deadlines. It is difficult to estimate exactly how much work is necessary to pay off the debt. For each change that is initiated, an uncertain amount of uncompleted work is committed to the project. The deadline is missed when the project realizes that there is more uncompleted work (debt) than there is time to complete it in. To have predictable release schedules, a development team should limit the amount of work in progress in order to keep the amount of uncompleted work (or debt) small at all times.
If enough work is completed on a project to not present a barrier to submission, then a project will be released which still carries a substantial amount of technical debt. If this software reaches production, then the risks of implementing any future refactors which might address the technical debt increase dramatically. Modifying production code carries the risk of outages, actual financial losses and possibly legal repercussions if contracts involve service-level agreements (SLA). For this reason we can view the carrying of technical debt to production almost as if it were an increase in interest rate and the only time this decreases is when deployments are turned down and retired.
"As an evolving program is continually changed, its complexity, reflecting deteriorating structure, increases unless work is done to maintain or reduce it."— Meir Manny Lehman, 1980
While Manny Lehman's Law already indicated that evolving programs continually add to their complexity and deteriorating structure unless work is done to maintain them, Ward Cunningham first drew the comparison between technical complexity and debt in a 1992 experience report:
"Shipping first time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite... The danger occurs when the debt is not repaid. Every minute spent on not-quite-right code counts as interest on that debt. Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation, object-oriented or otherwise."— Ward Cunningham, 1992
Activities that might be postponed include documentation, writing tests, attending to TODO comments and tackling compiler and static code analysis warnings. Other instances of technical debt include knowledge that isn't shared around the organization and code that is too confusing to be modified easily.
Grady Booch compares how evolving cities is similar to evolving software-intensive systems and how lack of refactoring can lead to technical debt.
"The concept of technical debt is central to understanding the forces that weigh upon systems, for it often explains where, how, and why a system is stressed. In cities, repairs on infrastructure are often delayed and incremental changes are made rather than bold ones. So it is again in software-intensive systems. Users suffer the consequences of capricious complexity, delayed improvements, and insufficient incremental change; the developers who evolve such systems suffer the slings and arrows of never being able to write quality code because they are always trying to catch up."— Grady Booch, 2014
In open source software, postponing sending local changes to the upstream project is a technical debt.
- Code smell (symptoms of inferior code quality that can contribute to technical debt)
- Big ball of mud
- Software rot
- Bus factor
- Escalation of commitment
- Software entropy
- Sunk costs
- TODO, FIXME, XXX
- Suryanarayana, Girish (November 2014). Refactoring for Software Design Smells (1st ed.). Morgan Kaufmann. p. 258. ISBN 978-0128013977. Retrieved 19 November 2014.
- Techopedia https://www.techopedia.com/definition/27913/technical-debt. Retrieved 17 May 2016. Missing or empty
- Jeffries, Ron. "Technical Debt – Bad metaphor or worst metaphor?". Archived from the original on November 10, 2015. Retrieved November 10, 2015.
- Knesek, Doug. "Averting a 'Technical Debt' Crisis". Retrieved April 7, 2016.
- Fowler, Martin. "Technical Debt Quadrant". Retrieved 20 November 2014.
- Lehman, MM (1996). "Laws of Software Evolution Revisited". EWSPT '96 Proceedings of the 5th European Workshop on Software Process Technology: 108–124. Retrieved 19 November 2014.
- Ward Cunningham (1992-03-26). "The WyCash Portfolio Management System". Retrieved 2008-09-26.
- Kerievsky, Joshua (2004). Refactoring to Patterns. ISBN 0-321-21335-1.
- Ward Explains Debt Metaphor, video from Ward Cunningham
- OnTechnicalDebt The online community for discussing technical debt
- Experts interviews on Technical Debt: Ward Cunningham, Philippe KRUCHTEN, Ipek OZKAYA, Jean-Louis LETOUZEY
- Steve McConnell discusses technical debt
- TechnicalDebt from Martin Fowler Bliki
- Averting a "Technical Debt" Crisis by Doug Knesek
- An Andy Lester talk entitled "Get out of Technical Debt Now!"
- Lehman's Law
- Managing Technical Debt Webinar by Steve McConnell
- Boundy, David, Software cancer: the seven early warning signs or here, ACM SIGSOFT Software Engineering Notes, Vol. 18 No. 2 (April 1993), Association for Computing Machinery, New York, NY, USA