当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
ReAssert: Deep Learning for Assert Generation
arXiv - CS - Software Engineering Pub Date : 2020-11-19 , DOI: arxiv-2011.09784
Robert White and Jens Krinke

The automated generation of test code can reduce the time and effort required to build software while increasing its correctness and robustness. In this paper, we present RE-ASSERT, an approach for the automated generation of JUnit test asserts which produces more accurate asserts than previous work with fewer constraints. This is achieved by targeting projects individually, using precise code-to-test traceability for learning and by generating assert statements from the method-under-test directly without the need to write an assert-less test first. We also utilise Reformer, a state-of-the-art deep learning model, along with two models from previous work to evaluate ReAssert and an existing approach, known as ATLAS, using lexical accuracy,uniqueness, and dynamic analysis. Our evaluation of ReAssert shows up to 44% of generated asserts for a single project match exactly with the ground truth, increasing to 51% for generated asserts that compile. We also improve on the ATLAS results through our use of Reformer with 28% of generated asserts matching exactly with the ground truth. Reformer also produces the greatest proportion of unique asserts (71%), giving further evidence that Reformer produces the most useful asserts.

中文翻译:

ReAssert:用于生成断言的深度学习

测试代码的自动生成可以减少构建软件所需的时间和精力,同时提高其正确性和健壮性。在本文中,我们介绍了 RE-ASSERT,这是一种自动生成 JUnit 测试断言的方法,它比以前的工作产生更准确的断言,约束更少。这是通过单独针对项目、使用精确的代码到测试可追溯性进行学习以及直接从被测方法生成断言语句而无需先编写无断言测试来实现的。我们还利用最先进的深度学习模型 Reformer 以及之前工作中的两个模型来评估 ReAssert,以及使用词汇准确性、唯一性和动态分析的现有方法 ATLAS。我们对 ReAssert 的评估显示,单个项目生成的断言中高达 44% 与基本事实完全匹配,编译生成的断言增加到 51%。我们还通过使用 Reformer 改进了 ATLAS 结果,其中 28% 的生成断言与基本事实完全匹配。改革者还产生最大比例的独特断言 (71%),进一步证明改革者产生了最有用的断言。
更新日期:2020-11-20
down
wechat
bug