Skip to main content

Finding Implicit Contracts in .NET Components

  • Conference paper
Formal Methods for Components and Objects (FMCO 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2852))

Included in the following conference series:

Abstract

Are contracts inherent in reusable libraries, or just one design technique among others? To help answer this question, we performed an empirical study of library classes from the .NET Collections library, which doesn’t use Design by ContractTM, to look for unexpressed contracts. This article reports on the buried contracts we have found, and discusses improvements to the architecture – especially to the libraries’ ease of learning and ease of use – that may result from making the contracts explicit. It extends previous reports [3,4,5,6] with an analysis of the benefits of an a posteriori addition of contracts for the library users.

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
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

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. Arnout, K., Simon, R.: The.NET Contract Wizard: Adding Design by Contract to languages other than Eiffel. In: TOOLS 39 (39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems), July 2001, pp. 14–23. IEEE Computer Society, Los Alamitos (2001)

    Chapter  Google Scholar 

  2. Arnout, K.: Eiffel for.NET: An Introduction. Component Developer Magazine (September- October 2002), Available from http://www.devx.com/codemag/Article/8500 (Accessed October 2002)

  3. Arnout, K., Meyer, B.: Extracting implicit contracts from.NET components. Microsoft Research Summer Workshop 2002, Cambridge, UK, September 9-11 (2002), Available from http://se.inf.ethz.ch/publications/arnout/workshops/microsoft_summer_research_workshop_2002/contract_extraction.pdf (Accessed September 2002)

  4. Arnout, K.: Extracting Implicit Contracts from.NET Libraries. 4th European GCSE Young Researchers Workshop 2002, in conjunction with NET.OBJECT DAYS 2002. Erfurt, Germany, October 7-10 (2002), IESE-Report No. 053.02/E, October 21, 2002, p 20–24, Available from http://www.cs.uni-essen.de/dawis/conferences/Node_YRW2002/papers/karine_arnout_gcse_final_copy.pdf (Accessed October 2002)

  5. Arnout, K.: Extracting Implicit Contracts from.NET Libraries. In: OOPSLA 2002 (17th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications), OOPSLA 2002 Companion, Posters. Seattle USA, November 4-8, pp. 104–105. ACM, New York (2002)

    Chapter  Google Scholar 

  6. Arnout, K., Meyer, B.: Contrats cachés en .NET: Mise au jour et ajout de contrats a posteriori. LMO 2003 (Langages et Modèles à Objets). Vannes, France, February 3-5(2003)

    Google Scholar 

  7. Arnout, K., Meyer, B.: Spotting hidden contracts: the.NET example (submitted for publication)

    Google Scholar 

  8. Barnett, M., Schulte, W.: Contracts, Components, and their Runtime Verification on the.NET Platform. Microsoft Research Technical Report TR 2002-38, April 2002, Available from ftp://ftp.research.microsoft.com/pub/tr/tr-2002-38.pdf (Accessed April 2002)

  9. Bezault, É.: Gobo Eiffel Lex and Gobo Eiffel Yacc. Retrieved (September 2002), from http://www.gobosoft.com

  10. Eiffel Software Inc. EiffelBase. Retrieved (October 2002), from http://docs.eiffel.com/libraries/base/index.html

  11. Ernst, M.D.: Dynamically Detecting Likely Program Invariants. Ph.D. dissertation, University of Washington (2000), Available from http://pag.lcs.mit.edu/~mernst/pubs/invariants-thesis.pdf (Accessed August 2002)

  12. Ernst, M.D., Cockrell, J., Griswold, W.G., Notkin, D.: Dynamically Discovering Likely Program Invariants to Support Program Evolution. IEEE TSE (Transactions on Software Engineering) 27(2), 1–25 (2001), Available From http://pag.lcs.mit.edu/~mernst/pubs/invariants-tse.pdf (Accessed August 2002)

    Google Scholar 

  13. Ernst, M.D., Czeisler, A., Griswold, W.G., Notkin, D.: Quickly Detecting Relevant Program Invariants. In: ICSE 2000 (International Conference on Software Engineering), Limerick, Ireland, June 4-11 (2000), Available from http://pag.lcs.mit.edu/~mernst/pubs/invariants-icse2000.pdf (Accessed August 2002)

  14. Ernst, M.D., Griswold, W.G., Kataoka, Y., Notkin, D.: Dynamically Discovering Program Invariants Involving Collections. Technical Report, University of Washington (2000), Available from http://pag.lcs.mit.edu/~mernst/pubs/invariantspointers.pdf (Accessed August 2002)

  15. Hoare, C.A.R.: Proof of Correctness of Data Representations. Acta Infomatica 1, 271–281 (1973)

    Article  Google Scholar 

  16. Kataoka, Y., Ernst, M.D., Griswold, W.G., Notkin, D.: Automated Support for Program Refactoring using Invariants. In: ICSM 2001 (International Conference on Software Maintenance), Florence, Italy, November 6-10 (2001), Available from http://pag.lcs.mit.edu/~mernst/pubs/invariants-refactor.pdf Accessed (August 2002)

  17. Kennedy, A., Syme, D.: Design and Implementation of Generics for the.NET Common Language Runtime. In: PLDI 2001 (Conference on Programming Language Design and Implementation), Snowbird, Utah, USA, June 20-22 (2001), Available from http://research.microsoft.com/projects/clrgen/generics.pdf Accessed (September 2002)

  18. Kennedy, A., Syme, D.: Generics for C# and.NET CLR (September 2002), Retrieved September 2002, from http://research.microsoft.com/projects/clrgen/

  19. McFarlane, K.: Design by Contract Framework for.Net (February 2002), Retrieved October 2002 from http://www.codeproject.com/csharp/designbycontract.asp , and http://www.codeproject.com/csharp/designbycontract.asp

  20. Meyer, B.: Object-Oriented Software Construction, 1st edn. Prentice Hall International, Englewood Cliffs (1988)

    Google Scholar 

  21. Meyer, B.: Applying Design by Contract. Technical Report TR-EI-12/CO, Interactive Software Engineering Inc. (1986); Published in IEEE Computer 25(10), 40–51 (October 1992); Also published as Mandrioli, D., Meyer, B. (eds.) Design by Contract in Advances in Object- Oriented Software Engineering, Prentice Hall, Reading, pp. 1–50 (1991), Available from http://www.inf.ethz.ch/personal/meyer/publications/computer/contract.pdf (Accessed April 2002)

  22. Meyer, B.: Reusable Software: The Base Object-Oriented Component Libraries. Prentice-Hall, Englewood Cliffs (1994)

    Google Scholar 

  23. Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice-Hall, Englewood Cliffs (1997)

    MATH  Google Scholar 

  24. Meyer, B., Simon, R., Stapf, E.: Instant.NET. Prentice-Hall, Englewood Cliffs (in preparation)

    Google Scholar 

  25. Meyer, B.: Design by Contract. Prentice Hall, Englewood Cliffs (in preparation)

    Google Scholar 

  26. Meyers, S.: Effective STL. Addison-Wesley, Reading (July 2001)

    Google Scholar 

  27. Microsoft .NET Collections library. Retrieved (June 2002), from http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpref/html/frlrfsystemcollections.asp

  28. Microsoft.NET ArrayList class. Retrieved (June 2002), from http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpref/html/frlrfsystemcollectionsarraylistclasstopic.asp

  29. Microsoft .NET ICollection interface. Retrieved (October 2002), from http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpref/html/frlrfsystemcollectionsicollectionclasstopic.asp

  30. Microsoft Research. Current research, Programming Principles and Tools. Retrieved (November 2002), from http://research.microsoft.com/research/ppt/

  31. Mitchell, R., McKim, J.: Design by Contract, by example. Addison-Wesley, Reading (2002)

    Google Scholar 

  32. NET Experts. ECMA TC39 TG2 and TG3 working documents. Retrieved (September 2002), from http://www.dotnetexperts.com/ecma/index.html

  33. Nimmer, J.W., Ernst, M.D.: Invariant Inference for Static Checking: An Empirical Evaluation. In: FSE 2002 (10th International Symposium on the Foundations of Software Engineering) Proceedings of the ACM SIGSOFT, Charleston, SC, USA, November 20-22 (2002), Available from http://pag.lcs.mit.edu/~mernst/pubs/esc-annotate.pdf (Accessed October 2002)

  34. Nimmer, J.W., Ernst, M.D.: Automatic generation of program specifications. In: ISSTA 2002 (International Symposium on Software Testing and Analysis), Rome, Italy, July 22-24 (2002), Available from http://pag.lcs.mit.edu/~mernst/pubs/invariantsspecs.pdf (Accessed October 2002)

  35. ResolveCorp. eXtensible C#© is here! Retrieved (May 2003), from http://www.resolvecorp.com/products.htm

  36. Simon, R., Stapf, E., Meyer, B.: Full Eiffel on.NET. MSDN, (July 2002), Available from http://msdn.microsoft.com/library/default.asp?url=/library/enus/dndotnet/html/pdc_eiffel.asp (Accessed October 2002)

  37. Software Engineering Institute. Volume II: Technical Concepts of Component-Based Software Engineering. CMU/SEI-2000-TR-008 (2000), Available from http://www.sei.cmu.edu/publications/documents/00.reports/00tr008.html (Accessed June 2002)

  38. Thomas, D.: The Deplorable State of Class Libraries. Journal of Object Technology (JOT), Vol.1(1) (May-June 2002), Available from http://www.jot.fm/issues/issue_2002_05/column2 (Accessed June 2002)

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Arnout, K., Meyer, B. (2003). Finding Implicit Contracts in .NET Components. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, WP. (eds) Formal Methods for Components and Objects. FMCO 2002. Lecture Notes in Computer Science, vol 2852. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39656-7_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-39656-7_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20303-2

  • Online ISBN: 978-3-540-39656-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics