Learning Deep Semantics for Test Completion

计算机科学 程序设计语言 甲骨文公司 单元测试 代码覆盖率 测试用例 语义学(计算机科学) 人工智能 测试套件 源代码 自然语言处理 软件 机器学习 回归分析
作者
Pengyu Nie,Rahul Banerjee,Junyi Jessy Li,Raymond J. Mooney,Milos Gligoric
标识
DOI:10.1109/icse48619.2023.00178
摘要

Writing tests is a time-consuming yet essential task during software development. We propose to leverage recent advances in deep learning for text and code generation to assist developers in writing tests. We formalize the novel task of test completion to automatically complete the next statement in a test method based on the context of prior statements and the code under test. We develop TECo-a deep learning model using code semantics for test completion. The key insight underlying TECO is that predicting the next statement in a test method requires reasoning about code execution, which is hard to do with only syntax-level data that existing code completion models use. Teco extracts and uses six kinds of code semantics data, including the execution result of prior statements and the execution context of the test method. To provide a testbed for this new task, as well as to evaluate TECO, we collect a corpus of 130,934 test methods from 1,270 open-source Java projects. Our results show that Teco achieves an exact-match accuracy of 18, which is 29% higher than the best baseline using syntax-level data only. When measuring functional correctness of generated next statement, Teco can generate runnable code in 29% of the cases compared to 18% obtained by the best baseline. Moreover, Teco is sianificantly better than prior work on test oracle generation.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
刚刚
1秒前
饼太发布了新的文献求助10
1秒前
2秒前
2秒前
小蘑菇应助大力的板栗采纳,获得10
2秒前
2秒前
cdercder应助舒心易烟采纳,获得10
3秒前
wsqg123发布了新的文献求助10
3秒前
zink发布了新的文献求助10
4秒前
李容容发布了新的文献求助10
4秒前
Kao应助dingding采纳,获得10
4秒前
4秒前
5秒前
5秒前
niu完成签到,获得积分10
5秒前
6秒前
7秒前
yy发布了新的文献求助10
7秒前
mm发布了新的文献求助10
7秒前
8秒前
8秒前
往事随风发布了新的文献求助30
8秒前
我我我发布了新的文献求助10
9秒前
9秒前
10秒前
10秒前
10秒前
LWDYF发布了新的文献求助20
10秒前
liss发布了新的文献求助10
10秒前
小胖子完成签到,获得积分10
11秒前
小二郎应助liyi采纳,获得10
11秒前
程程程哇完成签到,获得积分10
11秒前
11秒前
夏鳴发布了新的文献求助10
12秒前
yangmiemie发布了新的文献求助10
12秒前
PhDL1发布了新的文献求助10
12秒前
12秒前
科研通AI6.3应助xiaokezhang采纳,获得10
13秒前
文森特发布了新的文献求助10
13秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
模型平均及其应用 900
Nondestructive Testing Handbook: Vol. 4, Thermal and Infrared Testing (IR), 4th ed 800
作者名:Kristopher P. Plain,悉尼大学的,目前只能查到其四篇论文,想找到其博士论文 590
Évora na Idade Média 555
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
Structural Analysis 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7351771
求助须知:如何正确求助?哪些是违规求助? 8963204
关于积分的说明 19041046
捐赠科研通 7001013
什么是DOI,文献DOI怎么找? 3221374
关于科研通互助平台的介绍 2385854
邀请新用户注册赠送积分活动 2201812