Introduction
Locating the root cause of a software bug—fault localization—is often the most time-consuming phase of the debugging process. While early artificial intelligence research produced tools to assist programmers, many lacked a comprehensive "diagnostic theory." The core challenge in software debugging, as opposed to hardware troubleshooting, is the massive gap between structure (the raw source code) and function (the intended behavior). A single line of code might serve multiple purposes, and the same intent can be implemented in an infinite variety of ways. This paper proposes a formal diagnostic model that bridges this gap by reasoning about a program's goals and common human errors.
The FALOSY Framework
The authors introduce a framework implemented in a system called FALOSY (FAult Localization SYstem). The core of their approach relies on three primary pillars designed to mimic the reasoning of an expert programmer:
1. Functional Prototypes
Functional prototypes are hierarchical templates that describe how a program should look and behave. They include "recognition triggers" (keywords like read), pre- and post-conditions, and structural constraints. These prototypes exist at three distinct levels: the language level (syntax), the programming level (algorithms), and the application level (business logic).
2. Fault Models
Fault models represent a library of "known" bugs. Instead of simply identifying that "something is wrong," a fault model describes a specific error type, such as a "missing priming read" in a file-processing loop. This allows the system to categorize failures based on historical patterns of human error.
3. Localization Tactics
The system uses three distinct strategies to navigate the search space for bugs:
- Fault-driven: Starts with the symptoms (e.g., incorrect output) and attempts to match them to a known fault model.
- Function-driven: Checks if a specific high-level goal, such as "update master record," was implemented correctly according to its prototype.
- Computation-driven: Uses "program slicing" to isolate only the statements that affect a specific variable, then analyzes that "slice" for errors.
Key Insights and Methodology
A major innovation of this work is the treatment of diagnosis as search. The system treats debugging as a search through a hierarchy of prototypes. If the system cannot find a "correct" prototype that matches the code, it switches to fault models to see if the code matches a "known-bad" pattern.
This process relies heavily on intent inference through heuristic abstraction. The system does not just parse code; it uses triggers to guess the programmer's intent. For example, seeing a read statement before a while loop might trigger the "priming read" prototype. Furthermore, the system uses constraints to reject false leads. In one example, the system identifies three potential read statements but rejects two because they do not occur before the update loop, effectively reasoning about the program's topology.
Evaluation and Results
The paper evaluates the model using master file update programs, a common class of data-processing software. While the evaluation uses a specific system applied to a Pascal-like language rather than modern large-scale benchmarks, it demonstrates the theory's efficacy through detailed traces.
In a key demonstration, FALOSY localized a "missing priming read" error by:
- Hypothesizing the error based on output discrepancies.
- Recursively searching the program's structure and identifying all
readstatements. - Applying constraints (e.g., "the read must precede the update loop").
- Failing to find a valid implementation of the "master file priming read" prototype, thereby logically concluding that the fault was a missing statement.
Limitations and Future Directions
Despite its success in the tested domain, the system faces several challenges:
- Domain Specificity: The system relies on a pre-defined library of prototypes and fault models. Expanding this to general-purpose software would require a massive knowledge base.
- Implementation Complexity: Recognition-based abstraction can fail if the source code uses an "unfamiliar but correct" implementation that does not match any known prototype.
- Scalability: The paper does not address how the search space might expand in systems with millions of lines of code.
The authors suggest that future work should focus on more robust "functional matching" to augment structural matching, making the system more flexible across different programming styles.
Summary updated