Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1774088.1774546acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Dynamic contract layers

Published: 22 March 2010 Publication History

Abstract

Design by Contract (DBC) is a programming technique to separate contract enforcement from application code. DBC provides information about the applicability of methods and helps to narrow down the search space in case of a software failure. However, most DBC implementations suffer from inflexibility: Contract enforcement can only be activated or deactivated at compile-time or start-up, contracts are checked globally and cannot be restricted in their scope such as to the current thread of execution, and contracts cannot be grouped according to the concerns they relate to.
In this paper, we present dynamic contract layers (DCL) for fine-grained and flexible contract management. Based on ideas from context-oriented programming, we extend DBC by a grouping mechanism for contracts, thread-local activation and deactivation of such groups, and selective contract enforcement at run-time. PyDCL, our proof-of-concept implementation of DCL, is built onto ContextPy, our COP extension for the Python programming language. We evaluate our approach by applying PyDCL contracts to the Moin-Moin Wiki framework.

References

[1]
M. Appeltauer, R. Hirschfeld, M. Haupt, J. Lincke, and M. Perscheid. A Comparison of Context-Oriented Programming Languages. In International Workshop on Context-Oriented Programming, pages 1--6, 2009.
[2]
M. Appeltauer, R. Hirschfeld, and H. Masuhara. Improving the Development of Context-dependent Java Applications with ContextJ. In International Workshop on Context-Oriented Programming, pages 1--5, 2009.
[3]
I. Aracic, V. Gasiunas, M. Mezini, and K. Ostermann. Overview of CaesarJ. In Transactions on Aspect-Oriented Software Development, pages 135--173, 2006.
[4]
D. Arbuckle. PyDBC - Contracts for Python 2.2+. Version 0.2. http://savannah.nongnu.org/projects/pydbc/.
[5]
P. Costanza and R. Hirschfeld. Language Constructs for Context-oriented Programming: An Overview of ContextL. In Dynamic Languages Symposium, pages 1--10, 2005.
[6]
A. Duncan and U. Hoelzle. Adding Contracts to Java with Handshake. Technical Report TRCS98-32, University of California, Santa Barbara, USA, 1998.
[7]
T. Eisenbarth, R. Koschke, and D. Simon. Locating Features in Source Code. In Transactions on Software Engineering, volume 29, pages 210--224, 2003.
[8]
R. W. Floyd. Assigning Means To Programs. In Mathematical Aspects of Computer Science, volume 19, pages 19--31, 1967.
[9]
O. Greevy. Enriching Reverse Engineering with Feature Analysis. PhD thesis, University of Bern, 2007.
[10]
P. Guerreiro. Simple Support for Design by Contract in C++. In Technology of Object-Oriented Languages and Systems, page 24, 2001.
[11]
J. Hermann. The MoinMoin Wiki Engine - Easy to Use, Full-Featured and Extensible Wiki Software. Version 1.8.4. http://moinmo.in/.
[12]
R. Hirschfeld. AspectS - Aspect-Oriented Programming with Squeak. In International Conference NetObjectDays on Objects, Components, Architectures, Services, and Applications for a Networked World, pages 216--232, 2003.
[13]
R. Hirschfeld, P. Costanza, and M. Haupt. An Introduction to Context-Oriented Programming with ContextS. In Generative and Transformational Techniques in Software Engineering II, pages 396--407, 2008.
[14]
R. Hirschfeld, P. Costanza, and O. Nierstrasz. Context-Oriented Programming. In Journal of Object Technology, volume 7, pages 125--151, 2008.
[15]
C. A. R. Hoare. An Axiomatic Basis for Computer Programming. In Communications of the ACM, volume 26, pages 53--56, 1983.
[16]
J.-M. Jézéquel and B. Meyer. Design by Contract: The Lessons of Ariane. In Computer, volume 30, pages 129--130, 1997.
[17]
M. Karaorman, U. Hölzle, and J. Bruno. jContractor: A Reflective Java Library to Support Design By Contract. Technical Report TRCS98-31, University of California, Santa Barbara, USA, 1998.
[18]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An Overview of AspectJ. In European Conference on Object-Oriented Programming, pages 327--354, 2001.
[19]
G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented Programming. In European Conference on Object-Oriented Programming, pages 220--242, 1997.
[20]
R. Kramer. iContract - The Java Design by Contract Tool. In Technology of Object-Oriented Languages and Systems, page 295, 1998.
[21]
B. Meyer. Applying "Design by Contract". In Computer, volume 25, pages 40--51, 1992.
[22]
B. Meyer. Eiffel: The Language. Prentice-Hall, 1992.
[23]
B. Meyer. Object-Oriented Software Construction. Prentice-Hall, 1997.
[24]
D. L. Parnas. A Technique for Software Module Specification with Examples. In Communications of the ACM, volume 15, pages 330--336, 1972.
[25]
R. Plösch. Design By Contract for Python. Asia Pacific and International Software Engineering Conference., pages 213--219, 1997.
[26]
G. Schmidt. ContextR & ContextWiki - Modularisierung von Webanwendungen mit kontextorientierter Programmierung. Master's thesis, Hasso-Plattner-Institut an der Universität Potsdam, 2008.
[27]
J. Tantivongsathaporn and D. Stearns. An Experience With Design by Contract. In Asia Pacific Software Engineering Conference, pages 335--341, 2006.
[28]
G. Van Rossum. The Python Language Reference Manual. Network Theory Ltd., 2003.
[29]
M. von Löwis, M. Denker, and O. Nierstrasz. Context-Oriented Programming: Beyond Layers. In International Conference on Dynamic Languages, pages 143--156, 2007.
[30]
D. Wampler. Contract4J for Design by Contract in Java: Design Pattern-Like Protocols and Aspect Interfaces. In Workshop on Aspects, Components, and Patterns for Infrastructure Software, pages 27--30, 2006.
[31]
T. Way. ContractPy - Programming by Contract for Python. Version 1.4. http://www.wayforward.net/pycontract/.
[32]
A. Zeller. Why Programs Fail: A Guide to Systematic Debugging. Morgan Kaufmann, 2005.

Cited By

View all
  • (2019)IDVECompanion Proceedings of the 3rd International Conference on the Art, Science, and Engineering of Programming10.1145/3328433.3328453(1-16)Online publication date: 1-Apr-2019
  • (2018)Context-Oriented Algorithmic DesignProceedings of the 11th European Lisp Symposium on European Lisp Symposium10.5555/3323215.3323228(84-91)Online publication date: 18-Apr-2018
  • (2016)Ahead of time static analysis for automatic generation of debugging interfaces to the Linux kernelAutomated Software Engineering10.1007/s10515-014-0152-423:1(3-41)Online publication date: 1-Mar-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAC '10: Proceedings of the 2010 ACM Symposium on Applied Computing
March 2010
2712 pages
ISBN:9781605586397
DOI:10.1145/1774088
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 March 2010

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. context-oriented programming
  2. design by contract
  3. dynamic contract layers
  4. software composition

Qualifiers

  • Research-article

Conference

SAC'10
Sponsor:
SAC'10: The 2010 ACM Symposium on Applied Computing
March 22 - 26, 2010
Sierre, Switzerland

Acceptance Rates

SAC '10 Paper Acceptance Rate 364 of 1,353 submissions, 27%;
Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2019)IDVECompanion Proceedings of the 3rd International Conference on the Art, Science, and Engineering of Programming10.1145/3328433.3328453(1-16)Online publication date: 1-Apr-2019
  • (2018)Context-Oriented Algorithmic DesignProceedings of the 11th European Lisp Symposium on European Lisp Symposium10.5555/3323215.3323228(84-91)Online publication date: 18-Apr-2018
  • (2016)Ahead of time static analysis for automatic generation of debugging interfaces to the Linux kernelAutomated Software Engineering10.1007/s10515-014-0152-423:1(3-41)Online publication date: 1-Mar-2016
  • (2014)Applying Data-driven Tool Development to Context-oriented LanguagesProceedings of 6th ACM International Workshop on Context-Oriented Programming10.1145/2637066.2637067(1-7)Online publication date: 28-Jul-2014
  • (2014)Follow the path: Debugging state anomalies along execution histories2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE)10.1109/CSMR-WCRE.2014.6747162(124-133)Online publication date: Feb-2014
  • (2012)Family-based deductive verification of software product linesACM SIGPLAN Notices10.1145/2480361.237140448:3(11-20)Online publication date: 26-Sep-2012
  • (2012)Family-based deductive verification of software product linesProceedings of the 11th International Conference on Generative Programming and Component Engineering10.1145/2371401.2371404(11-20)Online publication date: 26-Sep-2012
  • (2012)Diagnosys: automatic generation of a debugging interface to the Linux kernelProceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering10.1145/2351676.2351686(60-69)Online publication date: 3-Sep-2012
  • (2012)Declarative layer composition in framework-based environmentsProceedings of the 4th ACM International Workshop on Context-Oriented Programming10.1145/2307436.2307437(1-6)Online publication date: 11-Jun-2012
  • (2010)Event-specific software composition in context-oriented programmingProceedings of the 9th international conference on Software composition10.5555/1894424.1894430(50-65)Online publication date: 1-Jul-2010
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media