On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach

Henrique Rebelo, Roberta Coelho, Ricardo Lima, Gary T. Leavens, Marieke Huisman, Alexandra Mota, Fernando Castor

Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

4 Citations (Scopus)

Abstract

Design by Contract (DbC) is a technique for developing and improving functional software correctness through defi- nition of “contracts‿ between client classes and their suppliers. Such contracts are enforced during runtime and if any of them is violated a runtime error should occur. Runtime assertions checkers (RACs) are a well-known technique that enforces such contracts. Although they are largely used to implement the DbC technique in contemporary languages, like Java, studies have shown that characteristics of contem- porary exception handling mechanisms can discard contract violations detected by RACs. As a result, a contract violation may not be reflected in a runtime error, breaking the supporting hypothesis of DbC. This paper presents an error recovery technique for RACs that tackles such limitations. This technique relies on aspect-oriented programming in order to extend the functionalities of existing RACs stop- ping contract violations from being discarded. We applied the recovery technique on top of five Java-based contemporary RACs (i.e., JML/jml, JML/ajml, JContractor, CEAP, and Jose). Preliminary results have shown that the pro- posed technique could actually prevent the contract violations from being discarded regardless of the characteristics of the exception handling code of the target application.
Original languageUndefined
Title of host publicationProceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011
EditorsS. Freund
Place of PublicationNew York
PublisherAssociation for Computing Machinery (ACM)
Pages7:1-7:6
Number of pages6
ISBN (Print)978-1-4503-0893-9
DOIs
Publication statusPublished - 26 Jul 2011
Event13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011 - Lancaster, United Kingdom
Duration: 26 Jul 201126 Jul 2011
Conference number: 13
http://www.cs.williams.edu/FTfJP2011/index.html

Publication series

Name
PublisherACM

Workshop

Workshop13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011
Abbreviated titleFTfJP
CountryUnited Kingdom
CityLancaster
Period26/07/1126/07/11
Internet address

Keywords

  • IR-77605
  • EWI-16994
  • METIS-277394

Cite this

Rebelo, H., Coelho, R., Lima, R., Leavens, G. T., Huisman, M., Mota, A., & Castor, F. (2011). On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach. In S. Freund (Ed.), Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011 (pp. 7:1-7:6). New York: Association for Computing Machinery (ACM). https://doi.org/10.1145/2076674.2076681
Rebelo, Henrique ; Coelho, Roberta ; Lima, Ricardo ; Leavens, Gary T. ; Huisman, Marieke ; Mota, Alexandra ; Castor, Fernando. / On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach. Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011. editor / S. Freund. New York : Association for Computing Machinery (ACM), 2011. pp. 7:1-7:6
@inproceedings{a5a9e88fcda147ccb4d79ca1ced715b3,
title = "On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach",
abstract = "Design by Contract (DbC) is a technique for developing and improving functional software correctness through defi- nition of “contracts‿ between client classes and their suppliers. Such contracts are enforced during runtime and if any of them is violated a runtime error should occur. Runtime assertions checkers (RACs) are a well-known technique that enforces such contracts. Although they are largely used to implement the DbC technique in contemporary languages, like Java, studies have shown that characteristics of contem- porary exception handling mechanisms can discard contract violations detected by RACs. As a result, a contract violation may not be reflected in a runtime error, breaking the supporting hypothesis of DbC. This paper presents an error recovery technique for RACs that tackles such limitations. This technique relies on aspect-oriented programming in order to extend the functionalities of existing RACs stop- ping contract violations from being discarded. We applied the recovery technique on top of five Java-based contemporary RACs (i.e., JML/jml, JML/ajml, JContractor, CEAP, and Jose). Preliminary results have shown that the pro- posed technique could actually prevent the contract violations from being discarded regardless of the characteristics of the exception handling code of the target application.",
keywords = "IR-77605, EWI-16994, METIS-277394",
author = "Henrique Rebelo and Roberta Coelho and Ricardo Lima and Leavens, {Gary T.} and Marieke Huisman and Alexandra Mota and Fernando Castor",
year = "2011",
month = "7",
day = "26",
doi = "10.1145/2076674.2076681",
language = "Undefined",
isbn = "978-1-4503-0893-9",
publisher = "Association for Computing Machinery (ACM)",
pages = "7:1--7:6",
editor = "S. Freund",
booktitle = "Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011",
address = "United States",

}

Rebelo, H, Coelho, R, Lima, R, Leavens, GT, Huisman, M, Mota, A & Castor, F 2011, On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach. in S Freund (ed.), Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011. Association for Computing Machinery (ACM), New York, pp. 7:1-7:6, 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011, Lancaster, United Kingdom, 26/07/11. https://doi.org/10.1145/2076674.2076681

On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach. / Rebelo, Henrique; Coelho, Roberta; Lima, Ricardo; Leavens, Gary T.; Huisman, Marieke; Mota, Alexandra; Castor, Fernando.

Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011. ed. / S. Freund. New York : Association for Computing Machinery (ACM), 2011. p. 7:1-7:6.

Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

TY - GEN

T1 - On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach

AU - Rebelo, Henrique

AU - Coelho, Roberta

AU - Lima, Ricardo

AU - Leavens, Gary T.

AU - Huisman, Marieke

AU - Mota, Alexandra

AU - Castor, Fernando

PY - 2011/7/26

Y1 - 2011/7/26

N2 - Design by Contract (DbC) is a technique for developing and improving functional software correctness through defi- nition of “contracts‿ between client classes and their suppliers. Such contracts are enforced during runtime and if any of them is violated a runtime error should occur. Runtime assertions checkers (RACs) are a well-known technique that enforces such contracts. Although they are largely used to implement the DbC technique in contemporary languages, like Java, studies have shown that characteristics of contem- porary exception handling mechanisms can discard contract violations detected by RACs. As a result, a contract violation may not be reflected in a runtime error, breaking the supporting hypothesis of DbC. This paper presents an error recovery technique for RACs that tackles such limitations. This technique relies on aspect-oriented programming in order to extend the functionalities of existing RACs stop- ping contract violations from being discarded. We applied the recovery technique on top of five Java-based contemporary RACs (i.e., JML/jml, JML/ajml, JContractor, CEAP, and Jose). Preliminary results have shown that the pro- posed technique could actually prevent the contract violations from being discarded regardless of the characteristics of the exception handling code of the target application.

AB - Design by Contract (DbC) is a technique for developing and improving functional software correctness through defi- nition of “contracts‿ between client classes and their suppliers. Such contracts are enforced during runtime and if any of them is violated a runtime error should occur. Runtime assertions checkers (RACs) are a well-known technique that enforces such contracts. Although they are largely used to implement the DbC technique in contemporary languages, like Java, studies have shown that characteristics of contem- porary exception handling mechanisms can discard contract violations detected by RACs. As a result, a contract violation may not be reflected in a runtime error, breaking the supporting hypothesis of DbC. This paper presents an error recovery technique for RACs that tackles such limitations. This technique relies on aspect-oriented programming in order to extend the functionalities of existing RACs stop- ping contract violations from being discarded. We applied the recovery technique on top of five Java-based contemporary RACs (i.e., JML/jml, JML/ajml, JContractor, CEAP, and Jose). Preliminary results have shown that the pro- posed technique could actually prevent the contract violations from being discarded regardless of the characteristics of the exception handling code of the target application.

KW - IR-77605

KW - EWI-16994

KW - METIS-277394

U2 - 10.1145/2076674.2076681

DO - 10.1145/2076674.2076681

M3 - Conference contribution

SN - 978-1-4503-0893-9

SP - 7:1-7:6

BT - Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011

A2 - Freund, S.

PB - Association for Computing Machinery (ACM)

CY - New York

ER -

Rebelo H, Coelho R, Lima R, Leavens GT, Huisman M, Mota A et al. On the Interplay of Exception Handling and Design by Contract: An Aspect-Oriented Recovery Approach. In Freund S, editor, Proceedings of the 13th Workshop on Formal Techniques for Java-like Programs, FTfJP 2011. New York: Association for Computing Machinery (ACM). 2011. p. 7:1-7:6 https://doi.org/10.1145/2076674.2076681