一句话:首个针对等价变异体检测的系统实证研究,表明 LLM 显著优于现有技术,平均 F1 提升 35.69%。
变异测试对保障软件质量至关重要,但等价变异体会带来冗余开销与偏差,削弱其实际效果。已有等价变异体检测(EMD)技术受限于训练数据稀缺且难以泛化到未见变异体。近期大语言模型(LLM)在多种代码任务中展现出更强的语义理解能力,但其在 EMD 上的表现尚不明确。本文在 3302 个方法级 Java 变异体对上开展实证研究,系统评估 LLM 用于 EMD 的有效性与效率:将 LLM 与现有 EMD 技术对比,考察不同 LLM 使用策略,分析各类 EMD 技术之间的正交性,并测量训练与推理时间开销。结果显示,基于 LLM 的技术显著优于现有方法(F1 平均提升 35.69%),其中微调代码嵌入策略最为有效;同时 LLM 技术在成本(训练与推理时间相对较低)与效果之间取得良好平衡。文章还讨论了模型规模与嵌入质量的影响,并给出未来研究方向。
Mutation testing is vital for ensuring software quality. However, the presence of equivalent mutants is known to introduce redundant cost and bias issues, hindering the effectiveness of mutation testing in practical use. Although numerous equivalent mutant detection (EMD) techniques have been proposed, they exhibit limitations due to the scarcity of training data and challenges in generalizing to unseen mutants. Recently, large language models (LLMs) have been extensively adopted in various code-related tasks and have shown superior performance by more accurately capturing program semantics. Yet the performance of LLMs in equivalent mutant detection remains largely unclear. In this paper, we conduct an empirical study on 3,302 method-level Java mutant pairs to comprehensively investigate the effectiveness and efficiency of LLMs for equivalent mutant detection. Specifically, we assess the performance of LLMs compared to existing EMD techniques, examine the various strategies of LLMs, evaluate the orthogonality between EMD techniques, and measure the time overhead of training and inference. Our findings demonstrate that LLM-based techniques significantly outperform existing techniques (i.e., the average improvement of 35.69% in terms of F1-score), with the fine-tuned code embedding strategy being the most effective. Moreover, LLM-based techniques offer an excellent balance between cost (relatively low training and inference time) and effectiveness. Based on our findings, we further discuss the impact of model size and embedding quality, and provide several promising directions for future research. This work is the first to examine LLMs in equivalent mutant detection, affirming their effectiveness and efficiency.
DOI 原文 ·
@inproceedings{paperbot8553,
title = {Large Language Models for Equivalent Mutant Detection: How Far Are We?},
author = {Zhao Tian and Honglin Shu and Dong Wang and Xuejie Cao and Yasutaka Kamei and Junjie Chen},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3680395}
}