Are Practitioners Writing Contracts?

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.

[1]  Bertrand Meyer,et al.  Object-oriented software construction (2nd ed.) , 1997 .

[2]  David Crocker,et al.  Safe Object-Oriented Software: The Verified Design-By-Contract Paradigm , 2004 .

[3]  Patrice Chalin,et al.  Logical foundations of program assertions: what do practitioners want? , 2005, Third IEEE International Conference on Software Engineering and Formal Methods (SEFM'05).

[4]  F. Petrus Cuperus,et al.  Eiffel Analysis, Design and Programming Language , 2005 .

[5]  James C. McKim,et al.  Design by Contract, By Example , 2001, TOOLS.

[6]  Jean-Louis Lanet,et al.  Java Applet Correctness: A Developer-Oriented Approach , 2003, FME.

[7]  John G. P. Barnes,et al.  High Integrity Software - The SPARK Approach to Safety and Security , 2003 .

[8]  Bertrand Meyer,et al.  Object-Oriented Software Construction, 2nd Edition , 1997 .

[9]  Bart Jacobs,et al.  JML (poster session): notations and tools supporting detailed design in Java , 2000, OOPSLA '00.

[10]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, Electron. Notes Theor. Comput. Sci..

[11]  Mark Lillibridge,et al.  Extended static checking for Java , 2002, PLDI '02.

[12]  Patrice Chalin,et al.  Non-null references by default in the Java modeling language , 2006, ACM SIGSOFT Softw. Eng. Notes.

[13]  Jeannette M. Wing Writing Larch interface language specifications , 1987, TOPL.

[14]  Robert E. Park,et al.  Software Size Measurement: A Framework for Counting Source Statements , 1992 .

[15]  K. Rustan M. Leino,et al.  Extended static checking , 1998, PROCOMET.

[16]  C. A. R. Hoare The Verifying Compiler, a Grand Challenge for Computing Research , 2005, VMCAI.

[17]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[18]  Stephen Gilmore,et al.  Mobile Resource Guarantees for Smart Devices , 2004, CASSIS.

[19]  C. A. R. Hoare,et al.  Assertions: A Personal Perspective , 2003, IEEE Ann. Hist. Comput..

[20]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[21]  Gary T. Leavens,et al.  JML: notations and tools supporting detailed design in Java , 2000 .

[22]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[23]  Heike Wehrheim,et al.  Jass - Java with Assertions , 2001, RV@CAV.

[24]  David R. Cok,et al.  ESC/Java2: Uniting ESC/Java and JML , 2004, CASSIS.

[25]  Stefania Gnesi,et al.  FME 2003: Formal Methods: International Symposium of Formal Methods Europe, Pisa, Italy, September 8-14, 2003. Proceedings , 2003, Lecture Notes in Computer Science.