Self-admitted technical debt (SATD) refers to comments in which developers explicitly acknowledge code issues, workarounds, or suboptimal solutions. SATD is known to significantly increase software maintenance effort. While extensive research has examined SATD in source code, its presence and impact in test code have received no focused attention, leaving a significant gap in our understanding of how SATD manifests in testing contexts. This study, the first of its kind, investigates SATD in test code by manually analyzing 50,000 comments randomly sampled from 1.6 million comments across 1,000 open-source Java projects. From this sample, after manual analysis and filtering, we identified 615 SATD comments and classified them into 14 distinct categories, building a taxonomy of test code SATD. To investigate whether test code SATD can be detected automatically, we evaluated existing SATD detection tools, as well as both open-source and proprietary LLMs. Among the existing tools, MAT performed the best, albeit with moderate recall. To our surprise, both open-source and proprietary LLMs exhibited poor detection accuracy, primarily due to low precision. These results indicate that neither existing approaches nor current LLMs can reliably detect SATD in test code. Overall, this work provides the first large-scale analysis of SATD in test code, a nuanced understanding of its types, and the limitations of current SATD detection methods. Our findings lay the groundwork for future research on test code-specific SATD.


翻译:自承认技术债务(SATD)指开发者在注释中明确承认代码问题、变通方案或次优解决方案的现象。已知SATD会显著增加软件维护工作量。尽管已有大量研究探讨源代码中的SATD,但其在测试代码中的存在与影响尚未获得专门关注,这导致我们对SATD在测试环境中如何呈现的理解存在重大空白。本研究作为该领域的首次探索,通过手动分析从1,000个开源Java项目的160万条注释中随机抽取的5万条注释,系统调查了测试代码中的SATD。经过人工分析与筛选,我们从样本中识别出615条SATD注释,并将其归类为14个独立类别,从而构建了测试代码SATD的分类体系。为探究测试代码SATD能否被自动检测,我们评估了现有SATD检测工具以及开源与专有大型语言模型(LLMs)。在现有工具中,MAT表现最佳,但召回率仅处于中等水平。令人意外的是,开源与专有LLMs均表现出较差的检测准确率,主要问题在于精确度偏低。这些结果表明,现有方法和当前LLMs均无法可靠检测测试代码中的SATD。总体而言,本研究首次对测试代码SATD进行了大规模分析,深入解析了其类型特征,并揭示了当前SATD检测方法的局限性。我们的发现为未来开展针对测试代码SATD的专项研究奠定了基础。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
AI生成代码缺陷综述
专知会员服务
15+阅读 · 2025年12月8日
Kaggle知识点:伪标签Pseudo Label
AINLP
40+阅读 · 2020年8月9日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员