arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.14764cs.SE
收藏

代码评审中潜在的技术债及其解决方案:对OpenStack和Qt社区的探索性研究

Potential Technical Debt and Its Resolution in Code Reviews: An Exploratory Study of the OpenStack and Qt Communities

Liming Fu, Peng Liang, Zeeshan Rasheed, Zengyang Li, Amjed Tahir, Xiaofeng Han

摘要:

技术债务(TD)是指开发人员为了实现短期目标而牺牲长期代码质量的情况,这可能对软件系统的质量产生负面影响。在代码评审的上下文中,这种次优实现有机会在代码合并之前的评审过程中及时解决。因此,我们可以将其视为潜在技术债务(PTD),因为当PTD被注入软件系统而没有得到解决时,它将演变为TD。到目前为止,对PTD在代码评审中被识别的程度知之甚少。为此,我们进行了一项探索性研究,试图了解代码审查中PTD的性质,并在识别后追踪PTD的解决方案。我们从OpenStack的Nova项目和Qt的Qt Base项目中随机收集了2,030条评论。然后,我们手动检查这些审查意见,并获得163个PTD相关的审查意见,以供进一步分析。我们的研究结果表明:(1)PTD可以在代码评审中识别,但并不普遍。(2)设计、缺陷、文档、需求、测试和代码PTD在代码评审中确定,其中代码和文档PTD占主导地位。(3)在代码评审中发现的PTD中,有81.0%已被开发人员解决,78.0%已解决的TD在一周内被开发人员解决。(4)代码重构是开发人员用来解决代码评审中识别的PTD的主要实践。我们的研究结果表明:(1)基于审查的PTD检测被视为开发中值得信赖的机制之一,(2)当注入软件系统时,仍有相当大比例的PTD(19.0%)仍未解决。实践者和研究者应该建立有效的策略来管理和解决发展中的PTD。

英文摘要:

Technical Debt (TD) refers to the situation where developers make trade-offs to achieve short-term goals at the expense of long-term code quality, which can have a negative impact on the quality of software systems. In the context of code review, such sub-optimal implementations have chances to be timely resolved during the review process before the code is merged. Therefore, we could consider them as Potential Technical Debt (PTD) since PTD will evolve into TD when it is injected into software systems without being resolved. To date, little is known about the extent to which PTD is identified in code reviews. To this end, we conducted an exploratory study in an attempt to understand the nature of PTD in code reviews and track down the resolution of PTD after being identified. We randomly collected 2,030 review comments from the Nova project of OpenStack and the Qt Base project of Qt. We then manually checked these review comments, and obtained 163 PTD-related review comments for further analysis. Our results show that: (1) PTD can be identified in code reviews but is not prevalent. (2) Design, defect, documentation, requirement, test, and code PTD are identified in code reviews, in which code and documentation PTD are the dominant. (3) 81.0% of the PTD identified in code reviews has been resolved by developers, and 78.0% of the resolved TD was resolved by developers within a week. (4) Code refactoring is the main practice used by developers to resolve the PTD identified in code reviews. Our findings indicate that: (1) review-based detection of PTD is seen as one of the trustworthy mechanisms in development, and (2) there is still a significant proportion of PTD (19.0%) remaining unresolved when injected into the software systems. Practitioners and researchers should establish effective strategies to manage and resolve PTD in development.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑