Adding Contracts to Java with Handshake

  • Authors:
  • Andrew Duncan;Urs Hoelzle

  • Affiliations:
  • -;-

  • Venue:
  • Adding Contracts to Java with Handshake
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Contracts describe an agreement between the writer and the user of a class. Their use enhances programmer productivity and program reliability, especially in library code. Handshake provides contracts for Java classes and interfaces in the form of class invariants and method pre- and postconditions. Using Handshake, a programmer can add contracts to classes and interfaces without needing access to their source code, without changing the class files, and without changing the JVM implementation. Unlike existing implementations of contracts for Java, Handshake intercepts the VM''s file operations and modifies classes on the fly without requiring any modification to the JVM itself. By using a dynamic link library interposed between the VM and the operating system, the system is relatively simple to port to a new OS and works with a variety of JVM implementations. The system imposes very little overhead other than the time required to evaluate the contract''s boolean expressions themselves.