From uncertainty to belief: inferring the specification within

  • Authors:
  • Ted Kremenek;Paul Twohey;Godmar Back;Andrew Ng;Dawson Engler

  • Affiliations:
  • Stanford University, Stanford, CA;Stanford University, Stanford, CA;Virginia Tech, Blacksburg, VA;Stanford University, Stanford, CA;Stanford University, Stanford, CA

  • Venue:
  • OSDI '06 Proceedings of the 7th symposium on Operating systems design and implementation
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Automatic tools for finding software errors require a set of specifications before they can check code: if they do not know what to check, they cannot find bugs. This paper presents a novel framework based on factor graphs for automatically inferring specifications directly from programs. The key strength of the approach is that it can incorporate many disparate sources of evidence, allowing us to squeeze significantly more information from our observations than previously published techniques. We illustrate the strengths of our approach by applying it to the problem of inferring what functions in C programs allocate and release resources. We evaluated its effectiveness on five codebases: SDL, OpenSSH, GIMP, and the OS kernels for Linux and Mac OS X (XNU). For each codebase, starting with zero initially provided annotations, we observed an inferred annotation accuracy of 80--90%, with often near perfect accuracy for functions called as little asfive times. Many of the inferred allocator and deallocator functions are functions for which we both lack the implementation and are rarely called---in some cases functions with at most one or two callsites. Finally, with the inferred annotations we quickly found both missing and incorrect properties in a specification used by a commercial static bug-finding tool.