arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

自我承认的技术债务是否经过测试?覆盖、共同变更与影响的实证研究

Is Self-Admitted Technical Debt Tested? An Empirical Study of Coverage, Co-change, and Impact

Suzuka Yoshimoto, Kosei Horikawa, Daniel Feitosa, Yutaro Kashiwa, Hajimu Iida

arXiv 2609.13485首次发表:更新:

发表机构

Nara Institute of Science and Technology; University of Groningen(奈良先端科学技术大学院大学; 格罗宁根大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

本研究实证分析八个Java项目中自我承认的技术债务(SATD)与测试的关系,发现债务移除很少伴随针对性测试,且测试与否对短期缺陷影响不大,但长期可能影响缺陷可观察性。

AI 中文摘要

当开发者编写TODO或FIXME注释时,他们明确承认代码并非最优:这是一个内置警告,提示该逻辑值得额外审查。然而,自我承认的技术债务(SATD)是否确实以软件测试的形式获得这种审查,仍是一个悬而未决的问题。我们旨在从三个维度刻画SATD与测试之间的关系:受SATD影响的代码被现有测试覆盖的程度、开发者是否将测试新增与债务解决同步进行,以及此类测试是否影响最终缺陷的长期可观察性。为此,我们对八个开源Java项目进行了实证研究,分析了最新版本中识别的784个SATD实例的测试覆盖率,并对5,175个SATD移除事件进行了纵向考察。我们的结果表明,尽管60.7%受SATD影响的代码被现有测试套件覆盖,但开发者很少将测试修改与债务解决同步进行;人工检查证实,仅有3.4%的SATD移除提交包含专门针对已解决债务的新测试(相比之下,12.5%的提交在同一提交中共同添加了测试)。纵向分析进一步表明,在短期至中期窗口内,无论测试修改与否,SATD解决方案表现出几乎相同的局部缺陷引入率。然而,在更长、不受限制的观察窗口内,出现了一个轻微的分歧,其中添加测试的组达到了更高的累积缺陷对齐概率(6.32%对4.37%),这一反直觉趋势可能由对固有复杂组件的选择性测试所驱动。开发者将SATD偿还视为普通代码变更,而非高风险维护活动:大多数债务移除在没有针对性验证的情况下进行,尽管开发者此前已标记代码为次优。

英文摘要

When developers write a TODO or FIXME comment, they are explicitly admitting that the code is suboptimal: a built-in warning that this logic deserves extra scrutiny. Yet it is an open question whether Self-Admitted Technical Debt (SATD) actually receives that scrutiny in the form of software testing. We aim to characterize the relationship between SATD and testing across three dimensions: the extent to which SATD-affected code is covered by existing tests, whether developers synchronize test additions with debt resolution, and whether such testing affects the long-term observability of resulting defects. For that, we conducted an empirical study on eight open-source Java projects, analyzing test coverage of 784 SATD instances identified in the latest releases and performing a longitudinal examination of 5,175 SATD removal events. Our results show that while 60.7% of SATD-affected code is covered by existing test suites, developers rarely synchronize test modifications with debt resolution; manual inspection confirms that only 3.4% of SATD removal commits include new tests specifically targeting the resolved debt (vs. 12.5% that co-add tests in the same commit). Longitudinal analysis further suggests that SATD resolutions exhibit nearly identical localized bug induction rates within short-to-medium-term windows regardless of test modifications. However, over a longer, unrestricted observation window, a slight divergence emerges where the test-added group reaches a higher cumulative defect alignment probability (6.32% vs. 4.37%), a counterintuitive trend potentially driven by the selective testing of inherently complex components. Developers treat SATD repayment as an ordinary code change rather than as a high-risk maintenance activity: most debt removals proceed without targeted verification, despite the developer's own prior flag that the code is suboptimal.

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑