Are Practitioners Writing Contracts?

  • Patrice Chalin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4157)

Abstract

For decades now, modular design methodologies have helped software engineers cope with the size and complexity of modern-day industrial applications. To be truly effective though, it is essential that module interfaces be rigorously specified. Design by Contract (DBC) is an increasingly popular method of interface specification for object-oriented systems. Many researchers are actively adding support for DBC to various languages such as Ada, Java and C#. Are these research efforts justified? Does having support for DBC mean that developers will make use of it? We present the results of an empirical study measuring the proportion of assertion statements used in Eiffel contracts. The study results indicate that programmers using Eiffel (the only active language with built-in support for DBC) tend to write assertions in a proportion that is higher than for other languages.

Keywords

design by contract program assertions empirical study Eiffel 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Barnes, J.: High Integrity Software: The Spark Approach to Safety and Security. Addison-Wesley, Reading (2003)Google Scholar
  2. 2.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# Programming System: An Overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Bartetzko, D., Fischer, C., Moller, M., Wehrheim, H.: Jass—Java with Assertions. Electronic Notes in Theoretical Computer Science 55(2), 103–117 (2001)CrossRefGoogle Scholar
  4. 4.
    Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Leino, K.R.M., Poll, E.: An Overview of JML Tools and Applications. International Journal on Software Tools for Technology Transfer (STTT) 7(3), 212–232 (2005)Google Scholar
  5. 5.
    Burdy, L., Requet, A., Lanet, J.-L.: Java Applet Correctness: A Developer-Oriented Approach. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, Springer, Heidelberg (2003)Google Scholar
  6. 6.
    Chalin, P.: Logical Foundations of Program Assertions: What do Practitioners Want? In: Proceedings of the Third International Conference on Software Engineering and Formal Methods (SEFM 2005), Koblenz, Germany, September 5-9, 2005. IEEE Computer Society Press, Los Alamitos (2005)Google Scholar
  7. 7.
    Chalin, P.: DbC and assertions in Eiffel: participants needed for quantitative research survey. EiffelWorld Electronic Newsletter 32(2) (2006)Google Scholar
  8. 8.
    Chalin, P., Rioux, F.: Non-null References by Default in the Java Modeling Language. In: Workshop on the Specification and Verification of Component-Based Systems (SAVCBS 2005), Lisbon, Portugal, September 2005. ACM Press, New York (2005)Google Scholar
  9. 9.
    Cok, D.R., Kiniry, J.R.: ESC/Java2: Uniting ESC/Java and JML. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 108–128. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  10. 10.
    Crocker, D.: Safe Object-Oriented Software: The Verified Design-By-Contract Paradigm. In: Practical Elements of Safety: Proceedings of the 12th Safety-Critical Systems Symposium, Birmingham, UK, February 2004. Springer, Heidelberg (2004)Google Scholar
  11. 11.
    Detlefs, D.L., Leino, K.R.M., Nelson, G., Saxe, J.B.: Extended Static Checking, Compaq Systems Research Center, Research Report 159 (December 1998)Google Scholar
  12. 12.
    ECMA International, Eiffel Analysis, Design and Programming Language, ECMA-367 (June 2005)Google Scholar
  13. 13.
    Evans, D.: Splint User Manual. Secure Programming Group, University of Virginia. (June 5, 2003)Google Scholar
  14. 14.
    Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for Java. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2002), June 2002, vol. 37(5), pp. 234–245. ACM Press, New York (2002)CrossRefGoogle Scholar
  15. 15.
    Hoare, C.A.R.: Assertions: Progress and Prospects (2001), http://research.microsoft.com/~thoare
  16. 16.
    Hoare, C.A.R.: Assertions: A Personal Perspective. IEEE Annals of the History of Computing 25(2), 14–25 (2003)CrossRefMathSciNetGoogle Scholar
  17. 17.
    Hoare, C.A.R.: The Verifying Compiler: A Grand Challenge for Computing Research. JACM 50(1), 63–69 (2003)CrossRefGoogle Scholar
  18. 18.
    Leavens, G.T., Leino, K.R.M., Poll, E., Ruby, C., Jacobs, B.: JML: Notations and Tools Supporting Detailed Design in Java. In: OOPSLA 2000 Companion, Minneapolis, Minnesota, pp. 105–106 (2000)Google Scholar
  19. 19.
    Meyer, B.: Applying Design by Contract. Computer 25(10), 40–51 (1992)CrossRefGoogle Scholar
  20. 20.
    Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice-Hall, Englewood Cliffs (1997)MATHGoogle Scholar
  21. 21.
    Mitchell, R., Jim, M.: Design by Contract, by Example. Addison-Wesley, Reading (2002)Google Scholar
  22. 22.
    Parasoft, Jcontract product page (2005), http://www.parasoft.com
  23. 23.
    Park, R.: Software Size Measurement: A Framework for Counting Source Statements, CMU, Software Engineering Institute, Pittsburgh CMU/SEI-92-TR-20 (1992)Google Scholar
  24. 24.
    Wheeler, D.A.: SLOCCount (2005), http://www.dwheeler.com/sloccount
  25. 25.
    Wilson, T., Maharaj, S.: Omnibus: A clean language for supporting DBC, ESC and VDBC. In: Proceedings of the Third International Conference on Software Engineering and Formal Methods (SEFM 2005), Koblenz, Germany, September 5-9, 2005. IEEE Computer Society Press, Los Alamitos (2005)Google Scholar
  26. 26.
    Wing, J.M.: Writing Larch Interface Language Specifications. ACM Trans. Program. Lang. Syst. 9(1), 1–24 (1987)MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Patrice Chalin
    • 1
  1. 1.Dept. of Computer Science and Software Engineering, Dependable Software Research GroupConcordia University 

Personalised recommendations