Advertisement

Nested and Dynamic Contract Boundaries

  • T. Stephen Strickland
  • Matthias Felleisen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6041)

Abstract

Previous work on software contracts assumes fixed and statically known boundaries between the parties to a contract. Implementations of contract monitoring systems rely on this assumption to explain the nature of contract violations and to assign blame to violators. In this paper, we explain how to implement arbitrary, nested, and dynamic contract boundaries with two examples. First, we add nestable contract regions to a static, first-order module system. Second, we show that even a dynamic, higher-order, and hierarchical module system can be equipped with software contracts that support precise blame assignment.

Keywords

Module System Unit System Contract Region Contract System Export Mapping 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Flatt, M., et al.: PLT Scheme. Reference Manual PLT-TR2009-reference-v4.2.1., PLT Scheme Inc. (January 2009), http://plt-scheme.org/techreports/
  2. 2.
    Beugnard, A., Jézéquel, J.M., Plouzeau, N., Watkins, D.: Making components contract aware. IEEE Software, 38–45 (June 1999)Google Scholar
  3. 3.
    Carrillo-Castellon, M., Garcia-Molina, J., Pimentel, E., Repiso, I.: Design by contract in Smalltalk. Journal of Object-Oriented Programming 7(9), 23–28 (1996)Google Scholar
  4. 4.
    Duncan, A., Hölzle, U.: Adding contracts to Java with Handshake. Technical Report TRCS98-32, The University of California at Santa Barbara (December 1998)Google Scholar
  5. 5.
    Edwards, S., Shakir, G., Sitaraman, M., Weide, B., Hollingsworth, J.: A framework for detecting interface violations in component-based software. In: Proceedings of the Fifth International Conference on Software Reuse, pp. 46–55. IEEE, Los Alamitos (June 1998)Google Scholar
  6. 6.
    Helm, R., Holland, I.M., Gangopadhyay, D.: Contracts: specifying behaviorial compositions in object-oriented systems. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications, pp. 169–180 (1990)Google Scholar
  7. 7.
    Kim, M., Kannan, S., Lee, I., Sokolsky, O., Viswanathan, M.: Java-MaC: a run-time assurance tool for Java. Electronic Notes in Theoretical Computer Science 55(2), 218–235 (2001)CrossRefzbMATHGoogle Scholar
  8. 8.
    Kramer, R.: iContract: the Java design by contract tool. In: Proceedings of Technology of Object-Oriented Languages and Systems, pp. 295–307 (August 1998)Google Scholar
  9. 9.
    Karaorman, M., Hölzle, U., Bruno, J.: jContractor: a reflective Java library to support design by contract. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 175–196. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  10. 10.
    Leavens, G.T., Leino, K.R.M., Poll, E., Ruby, C., Jacobs, B.: JML: notations and tools supporting detailed design in Java. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications, Companion, pp. 105–106 (2000)Google Scholar
  11. 11.
    Luckham, D.C.: Programming with Specifications: An Introduction to Anna, a Language for Specifying ADA Programs. Springer, Heidelberg (1990)CrossRefzbMATHGoogle Scholar
  12. 12.
    Microsoft Corporation: Microsoft C# Language Specifications. Microsoft Press (2001)Google Scholar
  13. 13.
    Meyer, B.: Applying design by contract. IEEE Computer 25(10), 40–51 (1992)CrossRefGoogle Scholar
  14. 14.
    Weck, W.: Inheritance using contracts and object composition. In: Proceedings of the Workshop on Components-Oriented Programming, pp. 384–388 (1997)Google Scholar
  15. 15.
    Gomes, B., Stoutamire, D., Vaysman, B., Klawitter, H.: A Language Manual for Sather 1.1 (August 1996)Google Scholar
  16. 16.
    Plösch, R., Pichler, J.: Contracts: from analysis to C++ implementation. In: Proceedings of Technology of Object-Oriented Languages and Systems, pp. 248–257 (August 1999)Google Scholar
  17. 17.
    Ruby, C., Leavens, G.T.: Safely creating correct subclasses without seeing superclass code. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications, pp. 208–228 (October 2000)Google Scholar
  18. 18.
    Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: Proceedings of the International Conference on Functional Programming, pp. 48–59 (October 2002)Google Scholar
  19. 19.
    Owens, S., Flatt, M.: From structures and functors to modules and units. In: Proceedings of the International Conference on Functional Programming, pp. 87–98 (September 2006)Google Scholar
  20. 20.
    Flatt, M., Felleisen, M.: Units: Cool modules for HOT languages. In: Proceedings of Programming Language Design and Implementation, pp. 236–248 (June 1998)Google Scholar
  21. 21.
    Strickland, T.S., Felleisen, M.: Contracts for first-class modules. In: Proceedings of the Fifth Dynamic Languages Symposium, pp. 27–38 (October 2009)Google Scholar
  22. 22.
    Szyperski, C.: Component Software. Addison-Wesley, Reading (1997)Google Scholar
  23. 23.
    Flatt, M.: Composable and compilable macros: You want it when?. In: Proceedings of the International Conference on Functional Programming, pp. 72–83 (October 2002)Google Scholar
  24. 24.
    Culpepper, R., Tobin-Hochstadt, S., Flatt, M.: Advanced macrology and the implementation of Typed Scheme. In: Proceedings of the Scheme Workshop, Université Laval Technical Report DIUL-RT-0701, pp. 1–14 (September 2007)Google Scholar
  25. 25.
    Leroy, X.: Manifest types, modules, and separate compilation. In: Proceedings of Principles of Programming Languages, pp. 109–122 (January 1994)Google Scholar
  26. 26.
    Harper, R., Lillibridge, M.: A type-theoretic approach to higher-order modules with sharing. In: Proceedings of Principles of Programming Languages, pp. 123–137 (January 1994)Google Scholar
  27. 27.
    Flatt, M., Findler, R.B., Felleisen, M.: Scheme with classes, mixins, and traits. In: Proceedings of the Asian Symposium on Programming Languages and Systems, pp. 270–289 (November 2006)Google Scholar
  28. 28.
    Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable units of behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  29. 29.
    Felleisen, M., Findler, R.B., Flatt, M., Krishnamurthi, S.: A functional i/o system or, fun for freshman kids. In: Proceedings of the International Conference on Functional Programming, pp. 47–58 (October 2009)Google Scholar
  30. 30.
    Findler, R.B., Blume, M.: Contracts as pairs of projections. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 226–241. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  31. 31.
    Parnas, D.L.: On the criteria to be used in decomposing systems into modules. Communications of the ACM 15, 1053–1058 (1972)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • T. Stephen Strickland
    • 1
  • Matthias Felleisen
    • 1
  1. 1.PLT @ Northeastern UniversityUSA

Personalised recommendations