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

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

计算机科学 > 软件工程

arXiv:2009.05634 (cs)
[提交于 2020年9月11日]

标题:Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformers

作者:Michele Tufano, Dawn Drain, Alexey Svyatkovskiy, Neel Sundaresan
查看论文《Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformers》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Unit testing represents the foundational basis of the software testing pyramid, beneath integration and end-to-end testing. Automated software testing researchers have proposed a variety of techniques to assist developers in this time-consuming task. In this paper we present an approach to support developers in writing unit test cases by generating accurate and useful assert statements. Our approach is based on a state-of-the-art transformer model initially pretrained on an English textual corpus. This semantically rich model is then trained in a semi-supervised fashion on a large corpus of source code. Finally, we finetune this model on the task of generating assert statements for unit tests. The resulting model is able to generate accurate assert statements for a given method under test. In our empirical evaluation, the model was able to predict the exact assert statements written by developers in 62% of the cases in the first attempt. The results show 80% relative improvement for top-1 accuracy over the previous RNN-based approach in the literature. We also show the substantial impact of the pretraining process on the performances of our model, as well as comparing it with assert auto-completion task. Finally, we demonstrate how our approach can be used to augment EvoSuite test cases, with additional asserts leading to improved test coverage.
主题: 软件工程 (cs.SE); 机器学习 (cs.LG)
引用方式: arXiv:2009.05634 [cs.SE]
  (或者 arXiv:2009.05634v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2009.05634
相关 DOI: https://doi.org/10.1145/3524481.3527220

提交历史

来自:Michele Tufano
[v1] 2020年9月11日 星期五 19:35:09 UTC
全文链接:

访问论文:

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

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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