← Latest papers
💻 computer science

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

This paper introduces a fully static, black-box approach that leverages Large Language Models to localize faults in complex system-level test code without executing the test case, achieving high accuracy while significantly reducing inference time and token usage compared to existing methods.

Original authors: Ahmadreza Saboor Yaraghi, Golnaz Gharachorlu, Sakina Fatima, Lionel C. Briand, Ruiyuan Wan, Ruifeng Gao

Published 2026-04-15
📖 5 min read🧠 Deep dive

Original authors: Ahmadreza Saboor Yaraghi, Golnaz Gharachorlu, Sakina Fatima, Lionel C. Briand, Ruiyuan Wan, Ruifeng Gao

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are the manager of a massive, high-tech video conference system. One day, the system crashes during a critical meeting. You have two main suspects:

  1. The System (SUT): The actual video conferencing software (the "engine").
  2. The Test Script (TC): The automated robot you built to check if the engine works (the "inspector").

Usually, when a test fails, developers assume the engine is broken and spend hours tearing it apart to find the problem. But often, the engine is fine! The problem is that the inspector robot is holding the wrong checklist or looking at the wrong thing. It's like a security guard shouting "Intruder!" because they forgot to turn off the motion sensor, not because there's actually an intruder.

This paper introduces a new, super-smart way to find out if the inspector robot is the one who made the mistake, without having to run the test over and over again (which can be expensive, slow, or impossible if the crash happens randomly).

Here is the breakdown of their solution using simple analogies:

1. The Problem: The "Black Box" Mystery

In the real world, testers often don't have access to the "engine's" internal blueprints (source code). They only see the outside. When the robot inspector fails, they get a log file—a long, messy transcript of what happened.

  • The Old Way: To find the bug, you usually have to run the test 100 times, compare the "good" runs with the "bad" runs, and see what changed. But what if the test costs $1,000 to run? Or what if the crash only happens once in a million tries? You can't do that.
  • The New Way: The authors use a Large Language Model (LLM)—think of it as a super-intelligent detective who has read every coding book in existence. This detective can look at the messy transcript and the robot's code and say, "Ah, I see the problem right here," without needing to run the test again.

2. The Challenge: Too Much Noise

The problem is that the robot's code is huge and complex. It talks to hundreds of different parts of the system. If you feed the entire code (thousands of lines) to the detective, they get overwhelmed. It's like asking a detective to find a needle in a haystack while blindfolded. Also, reading that much text takes a long time and costs a lot of money (in "tokens," which are the currency of AI).

3. The Solution: The "Pruning" Trick

The authors invented a clever three-step process to help the detective focus only on the important parts. They call this Execution Trace Estimation.

Think of the test code as a choose-your-own-adventure book.

  • Step 1: The Clue Hunt (Log Matching): The detective looks at the "failure transcript" (the log). They find specific sentences in the code that match sentences in the transcript.
    • Analogy: If the log says "Test 1 passed!" and the code has a line print("Test 1 passed!"), the detective knows that specific page of the book was read.
  • Step 2: Filling the Gaps (The "Fill-in-the-Gaps" Algorithm): The detective looks at the pages between the clues. If the book flows logically from Page 1 to Page 10, and we know Page 1 and Page 10 were read, the detective assumes the pages in between were read too.
  • Step 3: Cutting the Branches (CFG Analysis): This is the smartest part. The detective looks at the "If/Else" forks in the road.
    • Analogy: If the log says "We took the left path," the detective knows the "right path" pages were never read. They physically cut those pages out of the book.
    • They also check if the robot called any helper functions. If a helper function was never called, they cut that whole chapter out too.

The Result: They take a 1,000-page book and cut it down to just the 300 pages that were actually involved in the crash.

4. The Detective's Verdict

Now, the detective (the AI) only has to read those 300 pages.

  • Faster: It takes much less time to read a short book.
  • Cheaper: It costs less "tokens" to process.
  • Smarter: Because the book is shorter, the detective isn't distracted by irrelevant information and finds the bug more accurately.

5. The Results: Why It Matters

The authors tested this on real industrial data (from a company like Huawei).

  • Accuracy: Their "pruned" version of the code was so good that the AI found the bug just as well as if it had read the whole book. In fact, it found the bug 81% of the time in the top 3 guesses.
  • Speed: By cutting out the useless code, they made the AI 34% faster.
  • Cost: They reduced the amount of data the AI had to process by 93%.

The Big Picture

Imagine you are trying to find a typo in a 500-page novel, but you only have a note saying "There's a typo on page 400."

  • Old Method: You read the whole book 10 times to see where the story goes wrong.
  • This Paper's Method: You use a smart assistant to look at the note, realize the story only goes up to page 400, and then you tear out pages 401 to 500. Now you only have to read the first 400 pages to find the typo.

In summary: This paper teaches us how to use AI to find bugs in our testing tools (not just the software itself) by intelligently ignoring the parts of the code that didn't actually run. It saves time, money, and frustration for developers everywhere.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →