pith. machine review for the scientific record. sign in

arxiv: 1211.4775 · v6 · submitted 2012-11-20 · 💻 cs.SE

Recognition: unknown

Contracts in Practice

Authors on Pith no claims yet
classification 💻 cs.SE
keywords contractscontractprogramchangescodeelementsimplementationinheritance
0
0 comments X
read the original 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 percentage of program elements that include contracts is above 33% for most projects and tends to be stable over time; there is no strong preference for a certain type of contract element; contracts are quite stable compared to implementations; and inheritance does not significantly affect qualitative trends of contract usage.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 1 Pith paper

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Shift schema drift left: policy-aware compile-time contracts for typed JVM and Spark pipelines

    cs.PL 2026-04 unverdicted novelty 5.0

    A Scala framework enforces producer-to-contract schema compatibility at compile time under policies, derives Spark schemas, and performs enhanced runtime checks at data sinks.