Revisiting and Improving Retrieval-Augmented Deep Assertion Generation

计算机科学 断言 正确性 考试(生物学) 甲骨文公司 单元测试 集成测试 测试线束 测试用例 人工智能 情报检索 软件 软件工程 程序设计语言 机器学习 软件系统 古生物学 回归分析 软件建设 生物
作者
Weifeng Sun,Hongyan Li,Meng Yan,Yan Lei,Hongyu Zhang
标识
DOI:10.1109/ase56229.2023.00090
摘要

Unit testing validates the correctness of the unit under test and has become an essential activity in software development process. A unit test consists of a test prefix that drives the unit under test into a particular state, and a test oracle (e.g., assertion), which specifies the behavior in that state. To reduce manual efforts in conducting unit testing, Yu et al. proposed an integrated approach (integration for short), combining information retrieval with a deep learning-based approach, to generate assertions for a unit test. Despite being promising, there is still a knowledge gap as to why or where integration works or does not work. In this paper, we describe an in-depth analysis of the effectiveness of integration. Our analysis shows that: ① The overall performance of integration is mainly due to its success in retrieving assertions. ② integration struggles to understand the semantic differences between the retrieved focal-test (focal-test includes a test prefix and a unit under test) and the input focal-test, resulting in many tokens being incorrectly modified; ③ integration is limited to specific types of edit operations (i.e., replacement) and cannot handle token addition or deletion. To improve the effectiveness of assertion generation, this paper proposes a novel retrieve-and-edit approach named EDITAS. Specifically, Editas first retrieves a similar focal-test from a pre-defined corpus and treats its assertion as a prototype. Then, Editas reuses the information in the prototype and edits the prototype automatically. Editas is more generalizable than integration because it can ❶ comprehensively understand the semantic differences between input and similar focal-tests; ❷ apply appropriate assertion edit patterns with greater flexibility; and ❸ generate more diverse edit actions than just replacement operations. We conduct experiments on two large-scale datasets and the experimental results demonstrate that Editas outperforms the state-of-the-art approaches, with an average improvement of 10.00%-87.48% and 3.30%-42.65% in accuracy and BLEU score, respectively.

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
PDF的下载单位、IP信息已删除 (2025-6-4)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
salan应助猛犸象冲冲冲采纳,获得120
1秒前
领导范儿应助李亚琼采纳,获得10
2秒前
啧啧完成签到,获得积分10
2秒前
3秒前
元神发布了新的文献求助10
3秒前
赘婿应助Honor采纳,获得10
4秒前
万能图书馆应助凉悬采纳,获得10
4秒前
科目三应助啥也不会采纳,获得10
5秒前
隐形曼青应助大兵采纳,获得10
6秒前
周周完成签到,获得积分20
6秒前
6秒前
追寻凡霜完成签到,获得积分10
6秒前
充电宝应助silsotiscolor采纳,获得10
7秒前
li发布了新的文献求助10
7秒前
心静发布了新的文献求助30
7秒前
舒服的zhen发布了新的文献求助10
7秒前
情怀应助JAU采纳,获得10
8秒前
量子星尘发布了新的文献求助150
8秒前
9秒前
果冻完成签到,获得积分10
9秒前
丝竹丛中墨未干完成签到,获得积分10
10秒前
Lee发布了新的文献求助10
10秒前
沈彬彬发布了新的文献求助10
10秒前
11秒前
12秒前
褚访云发布了新的文献求助10
13秒前
不安青牛应助雪山飞龙采纳,获得10
13秒前
能干的玉兰完成签到,获得积分20
13秒前
kaka.29完成签到 ,获得积分10
14秒前
浮游完成签到,获得积分0
14秒前
15秒前
爱笑热狗完成签到,获得积分10
15秒前
15秒前
严小之完成签到,获得积分10
15秒前
纪鹏飞发布了新的文献求助10
16秒前
changping应助wtt采纳,获得20
16秒前
17秒前
清爽老九发布了新的文献求助30
17秒前
17秒前
噜啦啦发布了新的文献求助10
19秒前
高分求助中
Comprehensive Toxicology Fourth Edition 24000
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
World Nuclear Fuel Report: Global Scenarios for Demand and Supply Availability 2025-2040 800
The Social Work Ethics Casebook(2nd,Frederic G. R) 600
Handbook of Social and Emotional Learning 500
HEAT TRANSFER EQUIPMENT DESIGN Advanced Study Institute Book 500
Master Curve-Auswertungen und Untersuchung des Größeneffekts für C(T)-Proben - aktuelle Erkenntnisse zur Untersuchung des Master Curve Konzepts für ferritisches Gusseisen mit Kugelgraphit bei dynamischer Beanspruchung (Projekt MCGUSS) 500
热门求助领域 (近24小时)
化学 医学 生物 材料科学 工程类 有机化学 内科学 生物化学 物理 计算机科学 纳米技术 遗传学 基因 复合材料 化学工程 物理化学 病理 催化作用 免疫学 量子力学
热门帖子
关注 科研通微信公众号,转发送积分 5114368
求助须知:如何正确求助?哪些是违规求助? 4321651
关于积分的说明 13466439
捐赠科研通 4153360
什么是DOI,文献DOI怎么找? 2275740
邀请新用户注册赠送积分活动 1277730
关于科研通互助平台的介绍 1215701