跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2502.02708 (cs)
[提交于 2025年4月30日]

标题:AsserT5: Test Assertion Generation Using a Fine-Tuned Code Language Model

作者:Severin Primbs, Benedikt Fein, Gordon Fraser
查看论文《AsserT5: Test Assertion Generation Using a Fine-Tuned Code Language Model》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Writing good software tests can be challenging, therefore approaches that support developers are desirable. While generating complete tests automatically is such an approach commonly proposed in research, developers may already have specific test scenarios in mind and thus just require help in selecting the most suitable test assertions for these scenarios. This can be done using deep learning models to predict assertions for given test code. Prior research on assertion generation trained these models specifically for the task, raising the question how much the use of larger models pre-trained on code that have emerged since then can improve their performance. In particular, while abstracting identifiers has been shown to improve specifically trained models, it remains unclear whether this also generalises to models pre-trained on non-abstracted code. Finally, even though prior work demonstrated high accuracy it remains unclear how this translates into the effectiveness of the assertions at their intended application -- finding faults. To shed light on these open questions, in this paper we propose AsserT5, a new model based on the pre-trained CodeT5 model, and use this to empirically study assertion generation. We find that the abstraction and the inclusion of the focal method are useful also for a fine-tuned pre-trained model, resulting in test assertions that match the ground truth assertions precisely in up to 59.5\% of cases, more than twice as precise as prior models. However, evaluation on real bugs from the Defects4J dataset shows that out of 138 bugs detectable with assertions in real-world projects, AsserT5 was only able to suggest fault-finding assertions for 33, indicating the need for further improvements.
评论: Accepted for AST 2025 (https://conf.researchr.org/home/ast-2025)
主题: 软件工程 (cs.SE)
引用方式: arXiv:2502.02708 [cs.SE]
  (或者 arXiv:2502.02708v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2502.02708
相关 DOI: https://doi.org/10.1109/AST66626.2025.00008

提交历史

来自:Benedikt Fein
[v1] 2025年4月30日 星期三 00:00:00 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2025-04
切换浏览方式为:
cs

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站