Introduction
Technical Debt (TD) is a widely recognized metaphor describing the long-term maintenance costs incurred when developers prioritize short-term delivery over code quality. While significant research has focused on detecting and managing debt already present in a codebase, this study shifts the focus to the "pre-merge" phase. The authors introduce the concept of Potential Technical Debt (PTD)—sub-optimal code changes identified during the code review process that have not yet been integrated into the main repository.
By treating code review as a critical gatekeeper, this research explores how effectively reviewers identify these shortcuts and how often developers "repay" this debt before it becomes a permanent part of the software system.
Methodology
The researchers conducted an exploratory study using a Goal Question Metric (GQM) framework to analyze the lifecycle of PTD. The study focused on two mature, large-scale open-source ecosystems:
- OpenStack (Nova project): 992 sampled comments from a pool of nearly 14,000.
- Qt (Qt Base project): 1,038 sampled comments from a pool of over 36,000.
The researchers manually inspected a total of 2,030 review comments to achieve a 95% confidence level. Using established TD taxonomies, three researchers labeled the comments to identify the presence and type of debt. To track resolution, they performed a qualitative analysis of subsequent patchsets, comparing timestamps to determine how long the debt existed and whether it was resolved before the code was merged or abandoned.
The Nature of Potential Technical Debt
Prevalence and Detection
The study found that PTD is present in approximately 8% of all review comments. While this percentage may seem low, it represents a distinct category of feedback separate from standard bug fixes or stylistic preferences. A key finding is the role of the reviewer: 87.7% of PTD was identified by reviewers, while developers self-admitted to debt in only 2.5% of cases. This highlights code review as a vital mechanism for catching shortcuts that developers may overlook or fail to disclose.
Common Types of Debt
The researchers categorized PTD into several types based on existing literature:
- Code PTD (33.7%): The most frequent type, involving sub-optimal implementation choices.
- Documentation PTD (27.6%): Missing or inadequate comments and documentation.
- Requirement PTD: Issues related to incomplete features or missing logic.
Resolution Dynamics
Effectiveness of "Debt Prevention"
The code review process proved to be a highly effective filter. 81.0% of identified PTD was resolved before the code was merged. This suggests that the majority of "potential" debt is successfully prevented from becoming actual debt. However, 19.0% of identified issues still "leaked" into the main codebase, representing a failure of the gatekeeping process to enforce a complete fix.
Speed of Repayment
Resolution is generally rapid. 78.0% of resolved PTD was fixed within a single week, and over half was addressed in less than 24 hours. Documentation PTD was the fastest to be resolved (median 18 hours), likely because it represents "low-hanging fruit" for developers. In contrast, Requirement PTD was the most difficult to resolve, with a resolution rate of only 16.7%. These issues are often deferred because they depend on external factors or future release cycles.
Resolution Practices
When developers did address PTD, they primarily relied on two methods:
- Code Refactoring: Used in 50.9% of resolution cases.
- Documentation Improvement: Used in 25.8% of cases.
Limitations and Future Outlook
While the study provides a robust look at PTD, it is limited by a relatively small final sample of PTD-specific comments (163) and a focus on C++ and Python-heavy infrastructure projects. Manual labeling also introduces a degree of subjectivity, though the researchers achieved a high inter-rater reliability (Cohen’s Kappa of 0.81).
Future work aims to develop automated tools that can identify PTD within review comments in real-time. Such tools would help development teams track and manage shortcuts more systematically, ensuring that "potential" debt is addressed before it accumulates in the production environment.
Summary updated