Dynamic constraint detection for polymorphic behavior

  • Authors:
  • Nadya Kuzmina;Ruben Gamboa

  • Affiliations:
  • University of Wyoming;University of Wyoming

  • Venue:
  • Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic invariant detection, the automatic recovery of partial program specifications by inferring likely constraints from program executions, has been successful in the context of procedural programs. The implementation for dynamic invariant detection examines only the declared type of a variable, lacking many details in the context of object-oriented programs. This paper shows how this technique can be extended to detect invariants of object-oriented programs in the presence of polymorphism by examining the runtime type of a polymorphic variable, which may have different declared and runtime types. We demonstrate the improved accuracy of the dynamically detected specification on two real-world examples: the Money example from the JUnit testing framework tutorial, and a database query engine model example, which we adopted from a commercial database application. Polymorphic constraints in both cases are shown to reveal the specification of the runtime behavior of the systems.