Contracts in Practice
H.-Christian Estler, Carlo A. Furia, Martin Nordio, Marco Piccioni,, and Bertrand Meyer

TL;DR
This study empirically analyzes how software contracts are used, evolve, and relate to implementation changes across multiple projects, revealing stable contract usage and minimal inheritance impact.
Contribution
It provides the first large-scale empirical analysis of contract usage and evolution in real-world software projects across multiple programming languages.
Findings
Over 33% of program elements include contracts, stable over time.
No strong preference for specific contract element types.
Contracts are more stable than implementation code.
Abstract
Contracts are a form of lightweight formal specification embedded in the program text. Being executable parts of the code, they encourage programmers to devote proper attention to specifications, and help maintain consistency between specification and implementation as the program evolves. The present study investigates how contracts are used in the practice of software development. Based on an extensive empirical analysis of 21 contract-equipped Eiffel, C#, and Java projects totaling more than 260 million lines of code over 7700 revisions, it explores, among other questions: 1) which kinds of contract elements (preconditions, postconditions, class invariants) are used more often; 2) how contracts evolve over time; 3) the relationship between implementation changes and contract changes; and 4) the role of inheritance in the process. It has found, among other results, that: the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
