The Open UniversitySkip to content

A Catalog of Bad Smells in Design-by-Contract Methodologies with Java Modeling Language

Viana, Thiago (2013). A Catalog of Bad Smells in Design-by-Contract Methodologies with Java Modeling Language. Journal of Computing Science and Engineering, 7(4) pp. 251–262.

Full text available as:
PDF (Version of Record) - Requires a PDF viewer such as GSview, Xpdf or Adobe Acrobat Reader
Download (1MB) | Preview
DOI (Digital Object Identifier) Link:
Google Scholar: Look up in Google Scholar


Bad smells are usually related to program source code, arising from bad design and programming practices. Refactoring activities are often motivated by the detection of bad smells. With the increasing adoption of Design-by-Contract (DBC) methodologies in formal software development, evidence of bad design practices can similarly be found in programs that combine actual production code with interface contracts. These contracts can be written in languages, such as the Java Modeling Language (JML), an extension to the Java syntax. This paper presents a catalog of bad smells that appear during DBC practice, considering JML as the language for specifying contracts. These smells are described over JML constructs, although several can appear in other DBC languages. The catalog contains 6 DBC smells. We evaluate the recurrence of DBC smells in two ways: first by describing a small study with graduate student projects, and second by counting occurrences of smells in contracts from the JML models application programming interface (API). This API contains classes with more than 1,600 lines in contracts. Along with the documented smells, suggestions are provided for minimizing the impact or even removing a bad smell. It is believed that initiatives towards the cataloging of bad smells are useful for establishing good design practices in DBC.

Item Type: Journal Item
Copyright Holders: 2013 The Korean Institute of Information Scientists and Engineers
ISSN: 2093-8020
Keywords: Java Modeling Language; Bad smells; Design-By-Contract; Refactoring
Academic Unit/School: Faculty of Science, Technology, Engineering and Mathematics (STEM) > Computing and Communications
Faculty of Science, Technology, Engineering and Mathematics (STEM)
Item ID: 45530
Depositing User: Thiago de Melo Novaes Viana
Date Deposited: 03 Mar 2016 15:36
Last Modified: 07 Dec 2018 23:06
Share this page:


Altmetrics from Altmetric

Citations from Dimensions

Download history for this item

These details should be considered as only a guide to the number of downloads performed manually. Algorithmic methods have been applied in an attempt to remove automated downloads from the displayed statistics but no guarantee can be made as to the accuracy of the figures.

Actions (login may be required)

Policies | Disclaimer

© The Open University   contact the OU