Project-Scale Statement-Level Fault Localization via Multi-view Semantic Learning and Pairwise Reranking

计算机科学 人工智能 语义学(计算机科学) 断层(地质) 成对比较 一致性(知识库) 机器学习 自然语言处理 特征(语言学) 语义特征 数据挖掘 语义相似性 知识表示与推理 断层模型 钥匙(锁) 软件 语义计算 特征模型 语义鸿沟 深度学习 特征学习 文字蕴涵 语言模型 软件容错 二进制数
作者
Hongwei Yu,Xu Wang,Jian Zhang,Xiangxin Meng,Jiarui Li,Yang Liu,Chunming Hu
出处
期刊: [Association for Computing Machinery]
卷期号:3 (ISSTA): 4811-4833
标识
DOI:10.1145/3832301
摘要

Statement-level fault localization (FL) is critical for effective software debugging, as it enables developers to precisely identify faulty lines of code. While traditional spectrum-based, mutation-based, and deep learning-based FL techniques have achieved notable progress, they remain limited in modeling rich fault semantics. Recent advances in large language models (LLMs) offer new opportunities for FL due to their strong capacity for semantic understanding and reasoning over bugs. However, existing LLM-based FL approaches largely treat fault localization as isolated, code-centric prediction, limiting their ability to perform the holistic fault reasoning required for precise statement-level localization. In this paper, we propose FaultScape, a novel LLM-based framework for project-scale, statement-level FL that formulates FL as a multi-view semantic learning and reasoning problem. FaultScape addresses the limitations of existing approaches through three key components. First, we introduce a joint contrastive fine-tuning strategy that trains LLMs on large-scale bug-fix data to explicitly learn fault semantics from multiple complementary views. View-specific fault semantics, including code semantics, fault type, root cause, and repair intent, are learned via supervised binary classification, while cross-view semantic consistency is enforced through contrastive learning. These two objectives are jointly optimized within a unified training loss. The fine-tuned models extract multi-view fault likelihoods as semantic features for each suspicious statement. Second, we adopt a dynamic feature integration module that combines these semantic features with spectrum-based and mutation-based execution features, producing an initial suspiciousness statement ranking. Third, we design an LLM-based, test-guided pairwise re-ranking strategy that explicitly compares highly suspicious candidate statements using failing-test context. By estimating relative fault likelihoods through pairwise comparison rather than independent scoring, the model produces a refined statement-level ranking. We evaluate FaultScape on Defects4J v1.2.0, where it localizes 112/171/196 bugs at Top-1/3/5 out of 395, outperforming state-of-the-art DL-based and LLM-based baselines. On leakage-free benchmarks, FaultScape further localizes 11/18/20 bugs at Top-1/3/5 on ConDefects (31 bugs) and 12/21/22 bugs on GHRB (34 bugs), demonstrating strong generalization to unseen projects. These results show that combining multi-view fault semantics with contrastive, failure-guided reasoning substantially improves the effectiveness and robustness of statement-level fault localization.Statement-level fault localization (FL) is critical for effective software debugging, as it enables developers to precisely identify faulty lines of code. While traditional spectrum-based, mutation-based, and deep learning-based FL techniques have achieved notable progress, they remain limited in modeling rich fault semantics. Recent advances in large language models (LLMs) offer new opportunities for FL due to their strong capacity for semantic understanding and reasoning over bugs. However, existing LLM-based FL approaches largely treat fault localization as isolated, code-centric prediction, limiting their ability to perform the holistic fault reasoning required for precise statement-level localization. In this paper, we propose FaultScape, a novel LLM-based framework for project-scale, statement-level FL that formulates FL as a multi-view semantic learning and reasoning problem. FaultScape addresses the limitations of existing approaches through three key components. First, we introduce a joint contrastive fine-tuning strategy that trains LLMs on large-scale bug-fix data to explicitly learn fault semantics from multiple complementary views. View-specific fault semantics, including code semantics, fault type, root cause, and repair intent, are learned via supervised binary classification, while cross-view semantic consistency is enforced through contrastive learning. These two objectives are jointly optimized within a unified training loss. The fine-tuned models extract multi-view fault likelihoods as semantic features for each suspicious statement. Second, we adopt a dynamic feature integration module that combines these semantic features with spectrum-based and mutation-based execution features, producing an initial suspiciousness statement ranking. Third, we design an LLM-based, test-guided pairwise re-ranking strategy that explicitly compares highly suspicious candidate statements using failing-test context. By estimating relative fault likelihoods through pairwise comparison rather than independent scoring, the model produces a refined statement-level ranking. We evaluate FaultScape on Defects4J v1.2.0, where it localizes 112/171/196 bugs at Top-1/3/5 out of 395, outperforming state-of-the-art DL-based and LLM-based baselines. On leakage-free benchmarks, FaultScape further localizes 11/18/20 bugs at Top-1/3/5 on ConDefects (31 bugs) and 12/21/22 bugs on GHRB (34 bugs), demonstrating strong generalization to unseen projects. These results show that combining multi-view fault semantics with contrastive, failure-guided reasoning substantially improves the effectiveness and robustness of statement-level fault localization.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
彭于晏的应助被科研通管家采纳,获得10
刚刚
刚刚
巴音布鲁克完成签到 ,获得积分10
刚刚
风吹麦浪的应助被科研通管家采纳,获得10
刚刚
JamesPei的应助被科研通管家采纳,获得10
刚刚
传奇3的应助被科研通管家采纳,获得10
1秒前
1秒前
科研通AI2S的应助被勤奋千风采纳,获得10
1秒前
852的应助被科研通管家采纳,获得10
1秒前
东风的应助被科研通管家采纳,获得80
1秒前
今后的应助被科研通管家采纳,获得10
1秒前
wanci的应助被科研通管家采纳,获得10
1秒前
1秒前
2秒前
2秒前
木兮完成签到,获得积分10
2秒前
万力发布了新的文献求助10
2秒前
3秒前
3秒前
曹梦梦发布了新的文献求助10
4秒前
KYRIE发布了新的文献求助10
5秒前
健忘慕青完成签到,获得积分10
5秒前
可乐完成签到 ,获得积分20
5秒前
迅速白梅发布了新的文献求助10
6秒前
mimimi完成签到,获得积分10
6秒前
6秒前
6秒前
GWF完成签到,获得积分10
7秒前
7秒前
瓒ZAN发布了新的文献求助10
7秒前
7秒前
CodeCraft的应助被跳跳采纳,获得10
8秒前
zhangjingtao发布了新的文献求助10
8秒前
左右发布了新的文献求助20
9秒前
12秒前
玛奇玛发布了新的文献求助10
13秒前
无极微光的应助被czq采纳,获得20
13秒前
所所的应助被微血管采纳,获得10
13秒前
Un完成签到,获得积分10
13秒前
Zz完成签到,获得积分10
14秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Handbook of Sport Coaching Research 1000
突发性耳聋患者听觉障碍相关症状群管理的最佳证据总结 500
Orthognathic Surgery - 2 Volume Set 500
Sex, Aging, and Death in a Medieval Medical Compendium: Trinity College Cambridge MS R.14.52, Its Texts, Language, and Scribe 450
改訂11版 化学・バイオ特許の出願戦略 全文 400
《化学系特許明細書・意見書の書き方》全文 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8207511
求助须知:如何正确求助?哪些是违规求助? 9590701
关于积分的说明 21929835
捐赠科研通 7811792
什么是DOI,文献DOI怎么找? 3441995
关于科研通互助平台的介绍 2564257
邀请新用户注册赠送积分活动 2489413