Article

DECOR: A Method for the Specification and Detection of Code and Design Smells

Triskell Team, Univ. de Rennes 1, Rennes, France
IEEE Transactions on Software Engineering (Impact Factor: 1.61). 01/2010; 36(1):20-36. DOI: 10.1109/TSE.2009.50
Source: IEEE Xplore

ABSTRACT

Code and design smells are poor solutions to recurring implementation and design problems. They may hinder the evolution of a system by making it hard for software engineers to carry out changes. We propose three contributions to the research field related to code and design smells: 1) Decor, a method that embodies and defines all the steps necessary for the specification and detection of code and design smells, 2) Detex, a detection technique that instantiates this method, and 3) an empirical validation in terms of precision and recall of Detex. The originality of Detex stems from the ability for software engineers to specify smells at a high level of abstraction using a consistent vocabulary and domain-specific language for automatically generating detection algorithms. Using Detex, we specify four well-known design smells: the antipatterns Blob, Functional Decomposition, Spaghetti Code, and Swiss Army Knife, and their 15 underlying code smells, and we automatically generate their detection algorithms. We apply and validate the detection algorithms in terms of precision and recall on Xerces v2.7.0, and discuss the precision of these algorithms on 11 open-source systems.

  • Source
    • "Moha et al. (2010) documented relationships among code anomalies that are recurrently related to four design anomalies. According to them (Moha et al. 2010), relationships among Long Method and God Classes are usually indicators of Spaghetti Code design anomaly. The study by Abbes et al. (2011) brings up the notion of interaction effects across code anomalies. "

    Full-text · Article · Dec 2015
  • Source
    • ". This study was based on the detection rules proposed by Moha et al. [36] for the identification of the Blob antipattern. As an example, they suggest that classes with more than 90% of accessor methods can be characterized as data classes. "
    [Show abstract] [Hide abstract]
    ABSTRACT: Source code bad smells are usually resolved through the application of well-defined solutions, i.e., refactorings. In the literature, software metrics are used as indicators of the existence and prioritization of resolving bad smells. In this paper, we focus on the long method smell (i.e. one of the most frequent and persistent bad smells) that can be resolved by the extract method refactoring. Until now, the identification of long methods or extract method opportunities has been performed based on cohesion, size or complexity metrics. However, the empirical validation of these metrics has exhibited relatively low accuracy with regard to their capacity to indicate the existence of long methods or extract method opportunities. Thus, we empirically explore the ability of size and cohesion metrics to predict the existence and the refactoring urgency of long method occurrences, through a case study on java open-source methods. The results of the study suggest that one size and four cohesion metrics are capable of characterizing the need and urgency for resolving the long method bad smell, with a higher accuracy compared to the previous studies. The obtained results are discussed by providing possible interpretations and implications to practitioners and researchers.
    Full-text · Conference Paper · Oct 2015
  • Source
    • "(i.e., Large Class and Feature Envy), and partially confirms the work by Moha et al. [9] (i.e., Large Class and Low Cohesion). It also confirms the relation suggested by Lanza and Marinescu [31], who asserted that God Classes often display Dispersed Coupling and Intensive Coupling, that God Classes display Feature Envy, and that Feature Envious methods display Intensive Coupling. "

    Full-text · Conference Paper · Sep 2015
Show more