Skip to main content

Nested and Dynamic Contract Boundaries

  • Conference paper
Implementation and Application of Functional Languages (IFL 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6041))

  • 343 Accesses

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.

This research was partially supported by the US Air Force Office of Scientific Research and the National Science Foundation.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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. Beugnard, A., Jézéquel, J.M., Plouzeau, N., Watkins, D.: Making components contract aware. IEEE Software, 38–45 (June 1999)

    Google Scholar 

  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. 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. 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. 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. 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)

    Article  MATH  Google Scholar 

  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. 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)

    Chapter  Google Scholar 

  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. Luckham, D.C.: Programming with Specifications: An Introduction to Anna, a Language for Specifying ADA Programs. Springer, Heidelberg (1990)

    Book  MATH  Google Scholar 

  12. Microsoft Corporation: Microsoft C# Language Specifications. Microsoft Press (2001)

    Google Scholar 

  13. Meyer, B.: Applying design by contract. IEEE Computer 25(10), 40–51 (1992)

    Article  Google Scholar 

  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. Gomes, B., Stoutamire, D., Vaysman, B., Klawitter, H.: A Language Manual for Sather 1.1 (August 1996)

    Google Scholar 

  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. 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. 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. 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. 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. 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. Szyperski, C.: Component Software. Addison-Wesley, Reading (1997)

    Google Scholar 

  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. 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. Leroy, X.: Manifest types, modules, and separate compilation. In: Proceedings of Principles of Programming Languages, pp. 109–122 (January 1994)

    Google Scholar 

  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. 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. 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)

    Chapter  Google Scholar 

  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. 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)

    Chapter  Google Scholar 

  31. Parnas, D.L.: On the criteria to be used in decomposing systems into modules. Communications of the ACM 15, 1053–1058 (1972)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Strickland, T.S., Felleisen, M. (2010). Nested and Dynamic Contract Boundaries. In: Morazán, M.T., Scholz, SB. (eds) Implementation and Application of Functional Languages. IFL 2009. Lecture Notes in Computer Science, vol 6041. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-16478-1_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-16478-1_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-16477-4

  • Online ISBN: 978-3-642-16478-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics