From a domain analysis to the specification and detection of code and design smells

被引:34
作者
Moha, Naouel [1 ,2 ,4 ]
Gueheneuc, Yann-Gael [3 ]
Le Meur, Anne-Francoise [2 ]
Duchien, Laurence [2 ]
Tiberghien, Alban [2 ]
机构
[1] Univ Montreal, Ptidej Team, GEODES, DIRO, Montreal, PQ, Canada
[2] Univ Sci & Technol Lille, CNRS, LIFL UMR 8022, Adam Team,INRIA Lille Nord Europe, Villeneuve Dascq, France
[3] Ecole Polytech Montreal, Ptidej Team, DGIGL, Montreal, PQ, Canada
[4] INRIA Rennes Bretagne Atlantique, Triskell Team, IRISA, F-35042 Rennes, France
关键词
Design smells; Antipatterns; Code smells; Domain-specific language; Algorithm generation; Detection; !text type='Java']Java[!/text;
D O I
10.1007/s00165-009-0115-x
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code and design smells are recurring design problems in software systems that must be identified to avoid their possible negative consequences on development and maintenance. Consequently, several smell detection approaches and tools have been proposed in the literature. However, so far, they allow the detection of predefined smells but the detection of new smells or smells adapted to the context of the analysed systems is possible only by implementing new detection algorithms manually. Moreover, previous approaches do not explain the transition from specifications of smells to their detection. Finally, the validation of the existing approaches and tools has been limited on few proprietary systems and on a reduced number of smells. In this paper, we introduce an approach to automate the generation of detection algorithms from specifications written using a domain-specific language. This language is defined from a thorough domain analysis. It allows the specification of smells using high-level domain-related abstractions. It allows the adaptation of the specifications of smells to the context of the analysed systems. We specify 10 smells, generate automatically their detection algorithms using templates, and validate the algorithms in terms of precision and recall on Xerces v2.7.0 and GanttProject v1.10.2, two open-source object-oriented systems. We also compare the detection results with those of a previous approach, iPlasma.
引用
收藏
页码:345 / 361
页数:17
相关论文
共 27 条
[1]  
ALIKACEM EH, 2006, ACT 12 C LMO, P185
[2]  
[Anonymous], 1983, The Wadsworth statistics/Probability series
[3]  
[Anonymous], 1998, AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis
[4]  
[Anonymous], 1992, Information retrieval: Data structures and algorithms
[5]   Efficient relational calculation for software analysis [J].
Beyer, D ;
Noack, A ;
Lewerentz, C .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2005, 31 (02) :137-149
[6]   A METRICS SUITE FOR OBJECT-ORIENTED DESIGN [J].
CHIDAMBER, SR ;
KEMERER, CF .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1994, 20 (06) :476-493
[7]  
Florijn Gern., 2002, RevJava - Design critiques and architectural conformance checking for Java software
[8]  
Fowler M., 2018, Refactoring: Improving the Design of Existing Code
[9]  
Gamma Erich., 1994, DESIGN PATTERNS
[10]  
Geraci A., 1991, IEEE STANDARD COMPUT