AgentFL: Scaling LLM-based Fault Localization to Project-Level Context

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Qin, Yihao, Wang, Shangwen, Lou, Yiling, Dong, Jinhao, Wang, Kaixin, Li, Xiaoling, Mao, Xiaoguang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909507060236288
author Qin, Yihao
Wang, Shangwen
Lou, Yiling
Dong, Jinhao
Wang, Kaixin
Li, Xiaoling
Mao, Xiaoguang
author_facet Qin, Yihao
Wang, Shangwen
Lou, Yiling
Dong, Jinhao
Wang, Kaixin
Li, Xiaoling
Mao, Xiaoguang
contents Fault Localization (FL) is an essential step during the debugging process. With the strong capabilities of code comprehension, the recent Large Language Models (LLMs) have demonstrated promising performance in diagnosing bugs in the code. Nevertheless, due to LLMs' limited performance in handling long contexts, existing LLM-based fault localization remains on localizing bugs within a small code scope (i.e., a method or a class), which struggles to diagnose bugs for a large code scope (i.e., an entire software system). To address the limitation, this paper presents AgentFL, a multi-agent system based on ChatGPT for automated fault localization. By simulating the behavior of a human developer, AgentFL models the FL task as a three-step process, which involves comprehension, navigation, and confirmation. Within each step, AgentFL hires agents with diversified expertise, each of which utilizes different tools to handle specific tasks. Particularly, we adopt a series of auxiliary strategies such as Test Behavior Tracking, Document-Guided Search, and Multi-Round Dialogue to overcome the challenges in each step. The evaluation on the widely used Defects4J-V1.2.0 benchmark shows that AgentFL can localize 157 out of 395 bugs within Top-1, which outperforms the other LLM-based approaches and exhibits complementarity to the state-of-the-art learning-based techniques. Additionally, we confirm the indispensability of the components in AgentFL with the ablation study and demonstrate the usability of AgentFL through a user study. Finally, the cost analysis shows that AgentFL spends an average of only 0.074 dollars and 97 seconds for a single bug.
format Preprint
id arxiv_https___arxiv_org_abs_2403_16362
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle AgentFL: Scaling LLM-based Fault Localization to Project-Level Context
Qin, Yihao
Wang, Shangwen
Lou, Yiling
Dong, Jinhao
Wang, Kaixin
Li, Xiaoling
Mao, Xiaoguang
Software Engineering
Fault Localization (FL) is an essential step during the debugging process. With the strong capabilities of code comprehension, the recent Large Language Models (LLMs) have demonstrated promising performance in diagnosing bugs in the code. Nevertheless, due to LLMs' limited performance in handling long contexts, existing LLM-based fault localization remains on localizing bugs within a small code scope (i.e., a method or a class), which struggles to diagnose bugs for a large code scope (i.e., an entire software system). To address the limitation, this paper presents AgentFL, a multi-agent system based on ChatGPT for automated fault localization. By simulating the behavior of a human developer, AgentFL models the FL task as a three-step process, which involves comprehension, navigation, and confirmation. Within each step, AgentFL hires agents with diversified expertise, each of which utilizes different tools to handle specific tasks. Particularly, we adopt a series of auxiliary strategies such as Test Behavior Tracking, Document-Guided Search, and Multi-Round Dialogue to overcome the challenges in each step. The evaluation on the widely used Defects4J-V1.2.0 benchmark shows that AgentFL can localize 157 out of 395 bugs within Top-1, which outperforms the other LLM-based approaches and exhibits complementarity to the state-of-the-art learning-based techniques. Additionally, we confirm the indispensability of the components in AgentFL with the ablation study and demonstrate the usability of AgentFL through a user study. Finally, the cost analysis shows that AgentFL spends an average of only 0.074 dollars and 97 seconds for a single bug.
title AgentFL: Scaling LLM-based Fault Localization to Project-Level Context
topic Software Engineering
url https://arxiv.org/abs/2403.16362