Investigating the Use of JML Contracts


  • Alysson F. Milanez
  • Igor N. S. Ataı́de
  • Tiago L. Massoni


Design by Contract (DBC) is a methodology from formal methods research that aims the construction of quality software. With DBC the contracts become assertions that can be checked at runtime, fostering reliability for developers. In this work, we investigate the use of JML (Java Modeling Language) contracts by means of seven open-source projects and checked whether the contract used has some relationship with the kind of nonconformance that occurs in each project. For the projects considered, the most common contract types were precondition and postcondition. This result suggests developers apparently prefer to write pre- and postcondition clauses in comparison with invariants. Concerning the relationship between number of contract clauses and number of detected nonconformances, we found a moderate negative correlation; indicating that contracts with more clauses do not imply more nonconformances. This result may indicate developers who write bigger contracts tend to follow those contracts more closely.


Não há dados estatísticos.




Como Citar

Milanez, A. F. ., Ataı́de I. N. S., & Massoni, T. L. (2022). Investigating the Use of JML Contracts. Anais Do Encontro De Computação Do Oeste Potiguar ECOP/UFERSA (ISSN 2526-7574), 2(5). Recuperado de