An automatic verifier for Java-like programs based on dynamic frames

  • Authors:
  • Jan Smans;Bart Jacobs;Frank Piessens;Wolfram Schulte

  • Affiliations:
  • Katholieke Universiteit Leuven, Belgium;Katholieke Universiteit Leuven, Belgium;Katholieke Universiteit Leuven, Belgium;Microsoft Research Redmond

  • Venue:
  • FASE'08/ETAPS'08 Proceedings of the Theory and practice of software, 11th international conference on Fundamental approaches to software engineering
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Data abstraction is crucial in the construction of modular programs, since it ensures that internal changes in one module do not propagate to other modules. In object-oriented programs, classes typically enforce data abstraction by providing access to their internal state only through methods. By using method calls in method contracts, data abstraction can be extended to specifications. In this paper, methods used for this purpose must be side-effect free, and are called pure methods. We present an approach to the automatic verification of object-oriented programs that use pure methods for data abstraction. The cornerstone of our approach is the solution to the framing problem, i.e. client code must be able to determine whether state changes affect the return values of pure methods. More specifically, we extend each method contract with a method footprint, an upper bound on the memory locations read or written by the corresponding method. Footprints are specified using dynamic frames, special pure methods that return sets of memory locations. Thanks to this abstraction, implementations can evolve independently from specifications, loosely coupled only by pure functions. We implemented this approach in a custom build of the Spec# program verifier, and used it to automatically verify several challenging programs, including the iterator and observer patterns. The verifier itself and the examples shown in this paper can be downloaded from the authors' homepage [1].