Efficient Black-Box Fault Localization for System-Level Test Code Using Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yaraghi, Ahmadreza Saboor, Gharachorlu, Golnaz, Fatima, Sakina, Briand, Lionel C., Wan, Ruiyuan, Gao, Ruifeng
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917485443284992
author Yaraghi, Ahmadreza Saboor
Gharachorlu, Golnaz
Fatima, Sakina
Briand, Lionel C.
Wan, Ruiyuan
Gao, Ruifeng
author_facet Yaraghi, Ahmadreza Saboor
Gharachorlu, Golnaz
Fatima, Sakina
Briand, Lionel C.
Wan, Ruiyuan
Gao, Ruifeng
contents Fault localization (FL) is a critical step in debugging, which typically relies on repeated executions to pinpoint faulty code regions. However, repeated executions can be impractical in the presence of non-deterministic failures or high execution costs. While recent efforts have leveraged Large Language Models (LLMs) to aid execution-free FL, these have primarily focused on identifying faults in the system-under-test (SUT) rather than in the often complex system-level test code. However, the latter is also important, as in practice, many failures are triggered by faulty test code. To overcome these challenges, we introduce a fully static, LLM-driven approach for system-level test code fault localization (TCFL) that does not require executing the test case. Our method uses a single failure execution log to estimate the test's execution trace through three novel algorithms that identify only code statements likely involved in the failure. This pruned trace, combined with the error message, is used to prompt the LLM to rank potential faulty locations. Our black-box, system-level approach requires no access to the SUT source code and is applicable to complex test scripts that assess full system behavior. We evaluate our technique at the function, block, and line levels using an industrial dataset of faulty Python test cases that were not used in pre-training LLMs. Results show that our best-estimated traces closely match the actual traces, with an F1 score of around 90%. Additionally, pruning the complex system-level test code reduces the LLM's inference time by up to 34% without any loss in FL performance. Our method achieves equal or higher FL accuracy, requiring over 85% less average inference time per test case and 93% fewer tokens than the latest LLM-guided FL method.
format Preprint
id arxiv_https___arxiv_org_abs_2506_19045
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Efficient Black-Box Fault Localization for System-Level Test Code Using Large Language Models
Yaraghi, Ahmadreza Saboor
Gharachorlu, Golnaz
Fatima, Sakina
Briand, Lionel C.
Wan, Ruiyuan
Gao, Ruifeng
Software Engineering
Fault localization (FL) is a critical step in debugging, which typically relies on repeated executions to pinpoint faulty code regions. However, repeated executions can be impractical in the presence of non-deterministic failures or high execution costs. While recent efforts have leveraged Large Language Models (LLMs) to aid execution-free FL, these have primarily focused on identifying faults in the system-under-test (SUT) rather than in the often complex system-level test code. However, the latter is also important, as in practice, many failures are triggered by faulty test code. To overcome these challenges, we introduce a fully static, LLM-driven approach for system-level test code fault localization (TCFL) that does not require executing the test case. Our method uses a single failure execution log to estimate the test's execution trace through three novel algorithms that identify only code statements likely involved in the failure. This pruned trace, combined with the error message, is used to prompt the LLM to rank potential faulty locations. Our black-box, system-level approach requires no access to the SUT source code and is applicable to complex test scripts that assess full system behavior. We evaluate our technique at the function, block, and line levels using an industrial dataset of faulty Python test cases that were not used in pre-training LLMs. Results show that our best-estimated traces closely match the actual traces, with an F1 score of around 90%. Additionally, pruning the complex system-level test code reduces the LLM's inference time by up to 34% without any loss in FL performance. Our method achieves equal or higher FL accuracy, requiring over 85% less average inference time per test case and 93% fewer tokens than the latest LLM-guided FL method.
title Efficient Black-Box Fault Localization for System-Level Test Code Using Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2506.19045