Nakhla Rafi
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Research Subjects
Nakhla Rafi has a total of 13 co-authors. Here are the top co-authors by number of shared publications:
- Tse-Hsun (Peter) Chen
Concordia University, Canada
7 shared publications - Dong Jae Kim
DePaul University, USA
4 shared publications - Shaowei Wang
University of Manitoba, Winnipeg, Canada
3 shared publications - An Ran Chen
University of Alberta, Edmonton, Canada
2 shared publications - An Ran Chen
University of Alberta, Edmonton, Canada
1 shared publication - Jinqiu Yang
Concordia University, Montreal, Canada
1 shared publication
Latest Publications
- Open Access
- 20 November 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
LLM4FL: Multi-Agent Fault Localization via Graph Navigation and Verbal Reasoning
Locating and fixing software faults is challenging. Traditional Spectrum-Based Fault Localization (SBFL) uses test coverage and failure data but often suffers from low accuracy due to a lack of semantic understanding of code. Deep-learning approaches can improve localization, but require extensive training data and computational resources. Recent Large Language Models (LLMs) offer a promising alternative with stronger code reasoning capabilities. However, existing LLM-based fault localization techniques still struggle at the repository level due to large context windows and positional bias, in which important debugging signals may be buried in large contexts. In this work, we introduce LLM4FL , a multi-LLM-agent-based fault localization technique designed to address these challenges. LLM4FL uses three specialized agents. The Context Extraction Agent divides and prioritizes covered methods into token-fitting groups using an order-aware strategy based on Ochiai suspiciousness scores. The Debugger Agent navigates the repository through graph-based retrieval to generate failure reasoning and rank suspicious methods. The Reviewer Agent then re-evaluates and re-ranks the results through iterative self-refinement and verbal reasoning. Evaluated on Defects4J, LLM4FL improves Top-1 accuracy over prior LLM-based approaches, including AutoFL and SoapFL , by 14.5% and 4.58%, respectively. Our ablation study further highlights the importance of LLM4FL's design choices, with failure reason generation improving Top-1 performance by 12.5% and order-aware division substantially improving localization accuracy by 18.07%.
- 20 November 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
Open AccessLLM4FL: Multi-Agent Fault Localization via Graph Navigation and Verbal Reasoning
Locating and fixing software faults is challenging. Traditional Spectrum-Based Fault Localization (SBFL) uses test coverage and failure data but often suffers from low accuracy due to a lack of semantic understanding of code. Deep-learning approaches can improve localization, but require extensive training data and computational resources. Recent Large Language Models (LLMs) offer a promising alternative with stronger code reasoning capabilities. However, existing LLM-based fault localization techniques still struggle at the repository level due to large context windows and positional bias, in which important debugging signals may be buried in large contexts. In this work, we introduce LLM4FL , a multi-LLM-agent-based fault localization technique designed to address these challenges. LLM4FL uses three specialized agents. The Context Extraction Agent divides and prioritizes covered methods into token-fitting groups using an order-aware strategy based on Ochiai suspiciousness scores. The Debugger Agent navigates the repository through graph-based retrieval to generate failure reasoning and rank suspicious methods. The Reviewer Agent then re-evaluates and re-ranks the results through iterative self-refinement and verbal reasoning. Evaluated on Defects4J, LLM4FL improves Top-1 accuracy over prior LLM-based approaches, including AutoFL and SoapFL , by 14.5% and 4.58%, respectively. Our ablation study further highlights the importance of LLM4FL's design choices, with failure reason generation improving Top-1 performance by 12.5% and order-aware division substantially improving localization accuracy by 18.07%.
- Open Access
- 5 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 11-20
An Empirical Study of Waterfall-style Multi-Agent Workflows for Class-Level Code Generation
- 5 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 11-20
Open AccessAn Empirical Study of Waterfall-style Multi-Agent Workflows for Class-Level Code Generation
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 144-155
Order Matters! An Empirical Study on Large Language Models' Input Order Bias in Software Fault Localization
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 144-155
Open AccessOrder Matters! An Empirical Study on Large Language Models' Input Order Bias in Software Fault Localization
- 15 November 2025
- Published by Springer Nature in Empirical Software Engineering
- Vol. 31 (1) , 16
SBEST: Spectrum-based fault localization without fault-triggering tests
- 15 November 2025
- Published by Springer Nature in Empirical Software Engineering
- Vol. 31 (1) , 16
SBEST: Spectrum-based fault localization without fault-triggering tests
- Open Access
Crash Report Enhancement with Large Language Models: An Empirical Study
Crash reports are central to software maintenance, yet many lack the diagnostic detail developers need to debug efficiently. We examine whether large language models can enhance crash reports by adding fault locations, root-cause explanations, and repair suggestions. We study two enhancement strategies: Direct-LLM, a single-shot approach that uses stack-trace context, and Agentic-LLM, an iterative approach that explores the repository for additional evidence. On a dataset of 492 real-world crash reports, LLM-enhanced reports improve Top-1 problem-localization accuracy from 10.6% (original reports) to 40.2-43.1%, and produce suggested fixes that closely resemble developer patches (CodeBLEU around 56-57%). Both our manual evaluations and LLM-as-a-judge assessment show that Agentic-LLM delivers stronger root-cause explanations and more actionable repair guidance. A user study with 16 participants further confirms that enhanced reports make crashes easier to understand and resolve, with the largest improvement in repair guidance. These results indicate that supplying LLMs with stack traces and repository code yields enhanced crash reports that are substantially more useful for debugging.
Open AccessCrash Report Enhancement with Large Language Models: An Empirical Study
Crash reports are central to software maintenance, yet many lack the diagnostic detail developers need to debug efficiently. We examine whether large language models can enhance crash reports by adding fault locations, root-cause explanations, and repair suggestions. We study two enhancement strategies: Direct-LLM, a single-shot approach that uses stack-trace context, and Agentic-LLM, an iterative approach that explores the repository for additional evidence. On a dataset of 492 real-world crash reports, LLM-enhanced reports improve Top-1 problem-localization accuracy from 10.6% (original reports) to 40.2-43.1%, and produce suggested fixes that closely resemble developer patches (CodeBLEU around 56-57%). Both our manual evaluations and LLM-as-a-judge assessment show that Agentic-LLM delivers stronger root-cause explanations and more actionable repair guidance. A user study with 16 participants further confirms that enhanced reports make crashes easier to understand and resolve, with the largest improvement in repair guidance. These results indicate that supplying LLMs with stack traces and repository code yields enhanced crash reports that are substantially more useful for debugging.
- Open Access
- 12 July 2024
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 1 (FSE) , 1937-1959
Towards Better Graph Neural Network-Based Fault Localization through Enhanced Code Representation
Automatic software fault localization plays an important role in software quality assurance by pinpointing faulty locations for easier debugging. Coverage-based fault localization is a commonly used technique, which applies statistics on coverage spectra to rank faulty code based on suspiciousness scores. However, statisticsbased approaches based on formulae are often rigid, which calls for learning-based techniques. Amongst all, Grace , a graph-neural network (GNN) based technique has achieved state-of-the-art due to its capacity to preserve coverage spectra, i.e., test-to-source coverage relationships, as precise abstract syntax-enhanced graph representation, mitigating the limitation of other learning-based technique which compresses the feature representation. However, such representation is not scalable due to the increasing complexity of software, correlating with increasing coverage spectra and AST graph, making it challenging to extend, let alone train the graph neural network in practice. In this work, we proposed a new graph representation, DepGraph , that reduces the complexity of the graph representation by 70 % in nodes and edges by integrating the interprocedural call graph in the graph representation of the code. Moreover, we integrate additional features—code change information—into the graph as attributes so the model can leverage rich historical project data. We evaluate DepGraph using Defects4j 2.0.0, and it outperforms Grace by locating 20 % more faults in Top-1 and improving the Mean First Rank (MFR) and the Mean Average Rank (MAR) by over 50 % while decreasing GPU memory usage by 44 % and training/inference time by 85 % . Additionally, in cross-project settings, DepGraph surpasses the state-of-the-art baseline with a 42 % higher Top-1 accuracy, and 68 % and 65 % improvement in MFR and MAR, respectively. Our study demonstrates DepGraph ’s robustness, achieving state-of-the-art accuracy and scalability for future extension and adoption.
- 12 July 2024
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 1 (FSE) , 1937-1959
Open AccessTowards Better Graph Neural Network-Based Fault Localization through Enhanced Code Representation
Automatic software fault localization plays an important role in software quality assurance by pinpointing faulty locations for easier debugging. Coverage-based fault localization is a commonly used technique, which applies statistics on coverage spectra to rank faulty code based on suspiciousness scores. However, statisticsbased approaches based on formulae are often rigid, which calls for learning-based techniques. Amongst all, Grace , a graph-neural network (GNN) based technique has achieved state-of-the-art due to its capacity to preserve coverage spectra, i.e., test-to-source coverage relationships, as precise abstract syntax-enhanced graph representation, mitigating the limitation of other learning-based technique which compresses the feature representation. However, such representation is not scalable due to the increasing complexity of software, correlating with increasing coverage spectra and AST graph, making it challenging to extend, let alone train the graph neural network in practice. In this work, we proposed a new graph representation, DepGraph , that reduces the complexity of the graph representation by 70 % in nodes and edges by integrating the interprocedural call graph in the graph representation of the code. Moreover, we integrate additional features—code change information—into the graph as attributes so the model can leverage rich historical project data. We evaluate DepGraph using Defects4j 2.0.0, and it outperforms Grace by locating 20 % more faults in Top-1 and improving the Mean First Rank (MFR) and the Mean Average Rank (MAR) by over 50 % while decreasing GPU memory usage by 44 % and training/inference time by 85 % . Additionally, in cross-project settings, DepGraph surpasses the state-of-the-art baseline with a 42 % higher Top-1 accuracy, and 68 % and 65 % improvement in MFR and MAR, respectively. Our study demonstrates DepGraph ’s robustness, achieving state-of-the-art accuracy and scalability for future extension and adoption.
- Open Access
- 10 July 2024
- Published by Association for Computing Machinery (ACM)
- p. 686-688
Enhancing Code Representation for Improved Graph Neural Network-Based Fault Localization
Software fault localization in complex systems poses significant challenges. Traditional spectrum-based methods (SBFL) and newer learning-based approaches often fail to fully grasp the software’s complexity. Graph Neural Network (GNN) techniques, which model code as graphs, show promise but frequently overlook method in- teractions and code evolution. This paper introduces DepGraph, utilizing Gated Graph Neural Networks (GGNN) to incorporate interprocedural method calls and historical code changes, aiming for a more comprehensive fault localization. DepGraph’s graph rep- resentation merges code structure, method calls, and test coverage to enhance fault detection. Tested against the Defects4j bench- mark, DepGraph surpasses existing methods, notably improving fault detection by 13% at Top-1 and significantly improving Mean First Rank (MFR) and Mean Average Rank (MAR) by over 50%. It effectively utilizes historical code changes, boosting fault identi- fication by 20% at Top-1. Additionally, DepGraph’s optimization techniques reduce graph size by 70% and lower GPU memory use by 44%, indicating efficiency gains for GNN-based fault localization. In cross-project scenarios, DepGraph shows exceptional adaptability and performance, with a 42% increase in Top-1 accuracy and sub- stantial improvements in MFR and MAR, highlighting its robustness and versatility in various software environments.
- 10 July 2024
- Published by Association for Computing Machinery (ACM)
- p. 686-688
Open AccessEnhancing Code Representation for Improved Graph Neural Network-Based Fault Localization
Software fault localization in complex systems poses significant challenges. Traditional spectrum-based methods (SBFL) and newer learning-based approaches often fail to fully grasp the software’s complexity. Graph Neural Network (GNN) techniques, which model code as graphs, show promise but frequently overlook method in- teractions and code evolution. This paper introduces DepGraph, utilizing Gated Graph Neural Networks (GGNN) to incorporate interprocedural method calls and historical code changes, aiming for a more comprehensive fault localization. DepGraph’s graph rep- resentation merges code structure, method calls, and test coverage to enhance fault detection. Tested against the Defects4j bench- mark, DepGraph surpasses existing methods, notably improving fault detection by 13% at Top-1 and significantly improving Mean First Rank (MFR) and Mean Average Rank (MAR) by over 50%. It effectively utilizes historical code changes, boosting fault identi- fication by 20% at Top-1. Additionally, DepGraph’s optimization techniques reduce graph size by 70% and lower GPU memory use by 44%, indicating efficiency gains for GNN-based fault localization. In cross-project scenarios, DepGraph shows exceptional adaptability and performance, with a 42% increase in Top-1 accuracy and sub- stantial improvements in MFR and MAR, highlighting its robustness and versatility in various software environments.
- Open Access
- 14 April 2024
- Published by Association for Computing Machinery (ACM)
- p. 386-387
Exploring Data Cleanness in Defects4J and Its Influence on Fault Localization Efficiency
Defects4J stands out as the most popular benchmark in software testing research, known for its comprehensive collection of real bugs from open-source systems. This paper presents an in-depth study of Defects4J's fault-triggering tests, particularly examining the influence of developer modifications post-bug reports on spectrum-based fault localization (SBFL) techniques. Our findings reveal that 55% of these tests were newly added and 22% modified with developer knowledge, impacting the accuracy of SBFL. Notably, SBFL techniques' performance drops significantly (up to -415% in Mean First Rank) when developer knowledge is absent in the tests. We provide a curated dataset of bugs without this knowledge, facilitating more realistic evaluations of SBFL techniques using Defects4J. This research offers insights for the development of future bug benchmarks.
- 14 April 2024
- Published by Association for Computing Machinery (ACM)
- p. 386-387
Open AccessExploring Data Cleanness in Defects4J and Its Influence on Fault Localization Efficiency
Defects4J stands out as the most popular benchmark in software testing research, known for its comprehensive collection of real bugs from open-source systems. This paper presents an in-depth study of Defects4J's fault-triggering tests, particularly examining the influence of developer modifications post-bug reports on spectrum-based fault localization (SBFL) techniques. Our findings reveal that 55% of these tests were newly added and 22% modified with developer knowledge, impacting the accuracy of SBFL. Notably, SBFL techniques' performance drops significantly (up to -415% in Mean First Rank) when developer knowledge is absent in the tests. We provide a curated dataset of bugs without this knowledge, facilitating more realistic evaluations of SBFL techniques using Defects4J. This research offers insights for the development of future bug benchmarks.