Option contracts

Research output: Chapter in Book/Report/Conference proceedingConference contribution

4 Scopus citations

Abstract

Many languages support behavioral software contracts so that programmers can describe a component's obligations and promises via logical assertions in its interface. The contract system monitors program execution, checks whether the assertions hold, and, if not, blames the guilty component. Pinning down the violator gets the debugging process started in the right direction. Quality contracts impose a serious runtime cost, however, and programmers therefore compromise in many ways. Some turn off contracts for deployment, but then contracts and code quickly get out of sync during maintenance. Others test contracts randomly or probabilistically. In all cases, programmers have to cope with lack of blame information when the program eventually fails. In response, we propose option contracts as an addition to the contract tool box. Our key insight is that in ordinary contract systems, server components impose their contract on client components, giving them no choice whether to trust the server's promises or check them. With option contracts, server components may choose to tag a contract as an option and clients may choose to exercise the option or accept it, in which case they also shoulder some responsibility. We show that option contracts permit programmers to specify flexible checking policies, that their cost is reasonable, and that they satisfy a complete monitoring theorem.

Original languageEnglish (US)
Title of host publicationSPLASH Indianapolis 2013
Subtitle of host publicationOOPSLA 2013 - Proceedings of the 2013 International Conference on Object Oriented Programming Systems Languages and Applications
Pages475-494
Number of pages20
DOIs
StatePublished - 2013
Event2013 28th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2013 - Indianapolis, IN, United States
Duration: Oct 29 2013Oct 31 2013

Publication series

NameProceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA

Other

Other2013 28th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2013
CountryUnited States
CityIndianapolis, IN
Period10/29/1310/31/13

Keywords

  • Behavioral software contracts
  • Probabilistic spot checking
  • Programming language design
  • Random testing

ASJC Scopus subject areas

  • Software

Fingerprint Dive into the research topics of 'Option contracts'. Together they form a unique fingerprint.

Cite this