Bugs as Deviant Behavior: A General Approach to Inferring Errors in Systems Code

Abstract

A major obstacle to finding program errors in a real system is knowing what correctness rules the system must obey. These rules are often undocumented or specified in an ad hoc manner. This paper demonstrates techniques that automatically extract such checking information from the source code itself, rather than the programmer, thereby avoiding the need for a priori knowledge of system rules. The cornerstone of our approach is inferring programmer "beliefs" that we then cross-check for contradictions. Beliefs are facts implied by code: a dereference of a pointer, p, implies a belief that p is non-null, a call to "unlock(1)" implies that 1 was locked, etc. For beliefs we know the programmer must hold, such as the pointer dereference above, we immediately flag contradictions as errors. For beliefs that the programmer may hold, we can assume these beliefs hold and use a statistical analysis to rank the resulting errors from most to least likely. For example, a call to "spin_lock" followed once by a call to "spin_unlock" implies that the programmer may have paired these calls by coincidence. If the pairing happens 999 out of 1000 times, though, then it is probably a valid belief and the sole deviation a probable error. The key feature of this approach is that it requires no a priori knowledge of truth: if two beliefs contradict, we know that one is an error without knowing what the correct belief is.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Jan 01, 2001
Accession Number
ADA419584

Entities

People

  • Andy Chou
  • Benjamin Chelf
  • David Y. Chen
  • Dawson Engler
  • Seth Hallem

Organizations

  • Stanford University

Tags

Communities of Interest

  • Materials and Manufacturing Processes

DTIC Thesaurus Topics

  • Compilers
  • Computer Programming
  • Computer Programs
  • Computers
  • Consistency
  • Debugging
  • Device Drivers
  • Errors
  • Language
  • Machine Learning
  • Models
  • Observation
  • Operating Systems
  • Probability
  • Side Effects
  • Specifications
  • Statistical Analysis

Readers

  • Artificial Intelligence
  • Educational Psychology
  • Regression Analysis.

Technology Areas

  • AI & ML
  • AI & ML - Bayesian Inference