Effective test generation using pre-trained Large Language Models and mutation testing

考试(生物学) 突变 计算机科学 自然语言处理 遗传学 生物 基因 古生物学
作者
Arghavan Moradi Dakhel,Amin Nikanjam,Vahid Majdinasab,Foutse Khomh,Michel C. Desmarais
出处
期刊:Information & Software Technology [Elsevier BV]
卷期号:171: 107468-107468 被引量:52
标识
DOI:10.1016/j.infsof.2024.107468
摘要

One of the critical phases in the software development life cycle is software testing. Testing helps with identifying potential bugs and reducing maintenance costs. The goal of automated test generation tools is to ease the development of tests by suggesting efficient bug-revealing tests. Recently, researchers have leveraged Large Language Models (LLMs) of code to generate unit tests. While the code coverage of generated tests was usually assessed, the literature has acknowledged that the coverage is weakly correlated with the efficiency of tests in bug detection. To improve over this limitation, in this paper, we introduce MuTAP (Mutation Test case generation using Augmented Prompt) for improving the effectiveness of test cases generated by LLMs in terms of revealing bugs by leveraging mutation testing. Our goal is achieved by augmenting prompts with surviving mutants, as those mutants highlight the limitations of test cases in detecting bugs. MuTAP is capable of generating effective test cases in the absence of natural language descriptions of the Program Under Test (PUTs). We employ different LLMs within MuTAP and evaluate their performance on different benchmarks. Our results show that our proposed method is able to detect up to 28% more faulty human-written code snippets. Among these, 17% remained undetected by both the current state-of-the-art fully-automated test generation tool (i.e., Pynguin) and zero-shot/few-shot learning approaches on LLMs. Furthermore, MuTAP achieves a Mutation Score (MS) of 93.57% on synthetic buggy code, outperforming all other approaches in our evaluation. Our findings suggest that although LLMs can serve as a useful tool to generate test cases, they require specific post-processing steps to enhance the effectiveness of the generated test cases which may suffer from syntactic or functional errors and may be ineffective in detecting certain types of bugs and testing corner cases in PUTs.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
Yy杨优秀发布了新的文献求助10
刚刚
wanci的应助被暴躁的鸿采纳,获得30
1秒前
外向夜阑发布了新的文献求助10
1秒前
2秒前
2秒前
闪闪的青柏完成签到 ,获得积分10
2秒前
3秒前
3秒前
mawen完成签到 ,获得积分10
4秒前
4秒前
4秒前
4秒前
Charlie完成签到,获得积分10
4秒前
4秒前
活力的歪歪完成签到,获得积分10
5秒前
6秒前
问荐发布了新的文献求助10
6秒前
6秒前
7秒前
7秒前
多情昊焱完成签到 ,获得积分10
7秒前
ding的应助被xiaozuo采纳,获得10
8秒前
8秒前
希望天下0贩的0的应助被YYY采纳,获得10
8秒前
9秒前
亓雅丽完成签到 ,获得积分10
9秒前
9秒前
10秒前
You发布了新的文献求助10
11秒前
11秒前
11秒前
wenxin发布了新的文献求助10
12秒前
景清完成签到,获得积分10
12秒前
stay_hungry关注了科研通微信公众号
13秒前
多情昊焱关注了科研通微信公众号
13秒前
名小猫完成签到,获得积分10
14秒前
14秒前
14秒前
Hello的应助被清脆的书桃采纳,获得10
14秒前
hwq发布了新的文献求助30
14秒前
高分求助中
(应助此贴封号)通过应助OA文献获取积分 10000
Organizational Behavior 510
A Silent Apostrophe:The Fayum Portraits 350
Sing with Understanding: Introduction to Theology in Christian Congregational Song, 3rd ed 330
Fractal analysis evaluation of regenerated bone in grafted and graftless maxillary sinus elevation procedures 300
Protection enhancement strategies of potential outbreaks during Hajj 300
Management of a religious mass gathering in North India: Parkash Utsav 550 300
热门求助领域 (近24小时)
化学 材料科学 医学 生物 计算机科学 工程类 纳米技术 有机化学 化学工程 内科学 物理 生物化学 复合材料 催化作用 细胞生物学 人工智能 心理学 无机化学 基因 遗传学
热门帖子
关注 科研通微信公众号,转发送积分 7842191
求助须知:如何正确求助?哪些是违规求助? 9363590
关于积分的说明 20633924
捐赠科研通 7437252
什么是DOI,文献DOI怎么找? 3340267
关于科研通互助平台的介绍 2484666
邀请新用户注册赠送积分活动 2362356