亲爱的研友该休息了!由于当前在线用户较少,发布求助请尽量完整地填写文献信息,科研通机器人24小时在线,伴您度过漫漫科研夜!身体可是革命的本钱,早点休息,好梦!

TestART: Improving LLM-based Unit Test via Co-evolution of Automated Generation and Repair Iteration

考试(生物学) 单元测试 单位(环理论) 可靠性工程 计算机科学 数学 工程类 操作系统 生物 数学教育 生态学 软件
作者
Siqi Gu,Chunrong Fang,Quanjun Zhang,Fangyuan Tian,Jianyi Zhou,Zhenyu Chen
出处
期刊:Cornell University - arXiv
标识
DOI:10.48550/arxiv.2408.03095
摘要

Unit test is crucial for detecting bugs in individual program units but consumes time and effort. The existing automated unit test generation methods are mainly based on search-based software testing (SBST) and language models to liberate developers. Recently, large language models (LLMs) have demonstrated remarkable reasoning and generation capabilities. However, several problems limit their ability to generate high-quality test cases: (1) LLMs may generate invalid test cases under insufficient context, resulting in compilation errors; (2) Lack of test and coverage feedback information may cause runtime errors and low coverage rates. (3) The repetitive suppression problem causes LLMs to get stuck into the repetition loop of self-repair or re-generation attempts. In this paper, we propose TestART, a novel unit test generation method that leverages the strengths of LLMs while overcoming the limitations mentioned. TestART improves LLM-based unit test via co-evolution of automated generation and repair iteration. TestART leverages the template-based repair technique to fix bugs in LLM-generated test cases, using prompt injection to guide the next-step automated generation and avoid repetition suppression. Furthermore, TestART extracts coverage information from the passed test cases and utilizes it as testing feedback to enhance the sufficiency of the final test case. This synergy between generation and repair elevates the quality, effectiveness, and readability of the produced test cases significantly beyond previous methods. In comparative experiments, the pass rate of TestART-generated test cases is 78.55%, which is approximately 18% higher than both the ChatGPT-4.0 model and the same ChatGPT-3.5-based method ChatUniTest. It also achieves an impressive line coverage rate of 90.96% on the focal methods that passed the test, exceeding EvoSuite by 3.4%.
最长约 10秒,即可获得该文献文件

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

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
3秒前
儒雅老太完成签到,获得积分10
4秒前
华仔应助Maple采纳,获得10
10秒前
热情的寄瑶完成签到 ,获得积分10
26秒前
orixero应助罗舒采纳,获得30
33秒前
Shun完成签到 ,获得积分10
37秒前
42秒前
TXZ06完成签到,获得积分10
52秒前
xhy完成签到 ,获得积分10
59秒前
小神仙完成签到 ,获得积分10
1分钟前
Ephemerality完成签到 ,获得积分10
1分钟前
不去明知山完成签到 ,获得积分10
1分钟前
caca完成签到,获得积分0
1分钟前
1分钟前
罗舒发布了新的文献求助30
1分钟前
1分钟前
eritinn发布了新的文献求助10
1分钟前
eritinn完成签到,获得积分10
1分钟前
ljl86400完成签到,获得积分10
1分钟前
1分钟前
Jasper应助Heng采纳,获得10
1分钟前
1分钟前
1分钟前
2分钟前
Nakjeong完成签到 ,获得积分10
2分钟前
xuezha发布了新的文献求助10
2分钟前
郭燥发布了新的文献求助10
2分钟前
2分钟前
爱科研发布了新的文献求助10
2分钟前
生信精准科研完成签到,获得积分10
2分钟前
呜呜吴完成签到,获得积分10
2分钟前
2分钟前
2分钟前
2分钟前
孤独的大灰狼完成签到 ,获得积分10
2分钟前
feifei发布了新的文献求助10
2分钟前
3分钟前
yellow完成签到 ,获得积分10
3分钟前
bkagyin应助流萤采纳,获得30
3分钟前
爱科研完成签到,获得积分10
3分钟前
高分求助中
Ophthalmic Equipment Market by Devices(surgical: vitreorentinal,IOLs,OVDs,contact lens,RGP lens,backflush,diagnostic&monitoring:OCT,actorefractor,keratometer,tonometer,ophthalmoscpe,OVD), End User,Buying Criteria-Global Forecast to2029 2000
A new approach to the extrapolation of accelerated life test data 1000
Cognitive Neuroscience: The Biology of the Mind 1000
Technical Brochure TB 814: LPIT applications in HV gas insulated switchgear 1000
Immigrant Incorporation in East Asian Democracies 500
Nucleophilic substitution in azasydnone-modified dinitroanisoles 500
不知道标题是什么 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 冶金 细胞生物学 免疫学
热门帖子
关注 科研通微信公众号,转发送积分 3965642
求助须知:如何正确求助?哪些是违规求助? 3510896
关于积分的说明 11155529
捐赠科研通 3245353
什么是DOI,文献DOI怎么找? 1792856
邀请新用户注册赠送积分活动 874161
科研通“疑难数据库(出版商)”最低求助积分说明 804214