Learning About Software Errors Via Systematic Experimentation

Terrance Goan, Oren EtzioniAAAI 1994

Introduction

In the early development of autonomous agents, particularly AI "planners," systems often operated under the "Closed World Assumption." This paradigm assumed that the agent's internal model of the environment was a perfect reflection of reality. However, in dynamic software environments such as the UNIX operating system, this assumption frequently fails. External factors—such as concurrent users deleting files or changing permissions—introduce discrepancies between the agent's model and the actual state of the system. When an agent's command fails, it is presented with a text-based error message. To maintain robustness, the agent must not only detect the error but also diagnose its root cause to facilitate recovery.

The Error Detective (ED)

This paper introduces the "Error Detective" (ED), a system designed to automate the diagnosis of software errors. Rather than relying on manually encoded rules or complex natural language processing, ED treats error diagnosis as a supervised learning problem.

The core of ED is a decision tree classifier. The model utilizes a simplified feature set derived from the error message:

  1. Message Length: The total number of tokens in the error string.
  2. Token Presence: Binary indicators representing the presence or absence of specific keywords within the message.

The target classes for the decision tree are the specific failed preconditions (e.g., "file does not exist," "permission denied") that triggered the error message.

Methodology: Systematic Experimentation

To train the model, the authors employed a method of systematic experimentation within a software robot (softbot) environment. Instead of waiting for errors to occur naturally, the system intentionally violates specific preconditions and records the resulting error messages from UNIX commands like diff, ls, or pwd. This controlled generation of data allows the agent to learn a direct mapping between internal state failures and external textual signals.

Key Heuristics in Software Failures

The effectiveness of ED is supported by three fundamental observations regarding software behavior:

  • The Single-Signal Rule: Most software utilities report only the first error encountered during execution. For instance, if multiple files are missing, a command may only return an error for the first one it attempts to access.
  • Decomposable Faults: Software errors are generally independent and decomposable. Fixing the first reported error typically allows the agent to proceed to the next step, where any subsequent errors can be handled incrementally.
  • The Optimal Precondition Trade-off: The authors argue that it is often more computationally efficient to "try and fail" than to exhaustively verify every possible precondition (such as checking every parent directory's permissions) before executing a command.

Experimental Results

The authors evaluated ED against two baseline methods: a hand-crafted heuristic based on the presence of colons and a simple string-matching algorithm.

  • Diagnosis Accuracy: ED achieved an accuracy of 90.4%, significantly outperforming the hand-crafted heuristic (57%) and string matching (71.6%).
  • Efficiency Gains: Beyond accuracy, the implementation of ED led to a 63.6% reduction in the number of preconditions the softbot needed to re-verify or satisfy before retrying a task. By accurately identifying the failed precondition, the agent could bypass irrelevant checks and focus resources on the specific point of failure.

Conclusion and Future Directions

The Error Detective demonstrates that simple machine learning techniques, combined with systematic data collection, can significantly outperform manual error-handling logic. While the current study focuses on the relatively predictable environment of UNIX utilities, it lays the groundwork for more sophisticated, risk-aware AI agents. Future research may address the scalability of decision trees in larger systems and the complexities of multi-error payloads in modern distributed architectures, moving toward a model of "optimal" planning that balances the cost of verification against the cost of recovery.

Summary updated

BibTeX
@inproceedings{goan1994learning,
  author = {Terrance Goan and Oren Etzioni},
  title = {{Learning About Software Errors Via Systematic Experimentation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {1994},
}
Figure