Report ID
1998-32
Report Authors
Andrew Duncan and Urs Hoelzle
Report Date
Abstract
Contracts describe an agreement between the writer and the user of a class.Their use enhances programmer productivity and program reliability, especiallyin library code. Handshake provides contracts for Java classes and interfacesin the form of class invariants and method pre- and postconditions. UsingHandshake, a programmer can add contracts to classes and interfaces withoutneeding access to their source code, without changing the class files, andwithout changing the JVM implementation. Unlike existing implementations ofcontracts for Java, Handshake intercepts the VM\'s file operations and modifiesclasses on the fly without requiring any modification to the JVM itself. Byusing a dynamic link library interposed between the VM and the operatingsystem, the system is relatively simple to port to a new OS and works with avariety of JVM implementations. The system imposes very little overhead otherthan the time required to evaluate the contract\'s boolean expressionsthemselves.
Document
1998-32.ps179.5 KB