Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
jContractor: A Reflective Java Library to Support Design by ContractJanuary 1999
1999 Technical Report
Publisher:
  • University of California at Santa Barbara
  • Computer Science Dept. College of Engineering Santa Barbara, CA
  • United States
Published:19 January 1999
Reflects downloads up to 13 Sep 2024Bibliometrics
Skip Abstract Section
Abstract

jContractor is a purely library and design-pattern based approach to support Design By Contract specifications such as preconditions, postconditions, class invariants, and recovery and exception handling in Java. jContractor uses an intuitive naming convention, and standard Java syntax to instrument Java classes and enforce Design By Contract constructs. The designer of a class specifies a contract by defining protected methods which conform to the jContractor design patterns. jContractor uses Java Reflection to synthesize an instrumented version of a Java class containing jContractor contract specifications. The instrumented version contains code which enforces the Design By Contract specifications. Programmers enable the run-time enforcement of contracts by either incorporating the jContractor class loader or by instantiating  objects directly from the instrumented subclass through the jContractor  factory. Programmers can use exactly the same syntax for invoking methods and passing object references regardless of whether contracts are present or not. Since jContractor is purely library-based, it works with any Java implementation and requires no special tools such as modified compilers, modified JVMs, or pre-processors.

Cited By

Contributors
  • Texas Instruments
  • Google LLC

Recommendations