An exploratory study on cooccurrence of design patterns and bad smells using software metrics

被引:19
作者
Sousa, Bruno L. [1 ]
Bigonha, Mariza A. S. [1 ]
Ferreira, Kecia A. M. [2 ]
机构
[1] Univ Fed Minas Gerais, Dept Comp Sci, BR-31270901 Belo Horizonte, MG, Brazil
[2] Fed Ctr Technol Educ Minas Gerais CEFET MG, Dept Comp, Belo Horizonte, MG, Brazil
关键词
bad smell; cooccurrence; design pattern; software metrics; CODE SMELLS;
D O I
10.1002/spe.2697
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A design pattern is a general reusable solution to commonly recurring problems in software projects. Bad smells are symptoms existing in the source code that possibly indicate the presence of a structural problem that requires code refactoring. Although design pattern and bad smells be different concepts, literature has shown that they may be related and cooccur during the evolution of a software system. This paper presents an empirical study that investigates cooccurrences of design patterns and bad smells as well as identifies the main factors that contribute to the emergence of the relationship between them. We carried out a case study with five Java systems to: (1) investigate if the use of design pattern reduces bad smell occurrence, (2) identify cooccurrences of design patterns and bad smells, and (3) identify situations that contribute for the cooccurrence emergence. As the main result, we found that the application of design pattern not necessarily avoid bad smell occurrences. The results also show that some design patterns such as composite, factory method, and singleton, are intrinsically modular and might be useful in creating high-quality systems. However, other design patterns such as adapter-command, proxy, and state-strategy, have presented high cooccurrence frequency with bad smells; therefore, they require attention in their implementation. Finally, via manual inspection in the components with cooccurrence, we found that the identified cooccurrences appeared due to poor planning and inadequate application of design patterns.
引用
收藏
页码:1079 / 1113
页数:35
相关论文
共 42 条
[1]  
Agrawal R., 1993, SIGMOD Record, V22, P207, DOI 10.1145/170036.170072
[2]  
[Anonymous], AUTOM SOFTW ENG
[3]  
[Anonymous], THESIS
[4]  
Bhardwaj S, 2016, IEEE C ANTENNA MEAS
[5]  
Brin S., 1997, SIGMOD Record, V26, P255, DOI [10.1145/253262.253327, 10.1145/253262.253325]
[6]  
Cardoso B, 2015, P ANN C BRAZ S INF S
[7]   Automated refactoring to the Strategy design pattern [J].
Christopoulou, Aikaterini ;
Giakoumakis, E. A. ;
Zafeiris, Vassilis E. ;
Soukara, Vasiliki .
INFORMATION AND SOFTWARE TECHNOLOGY, 2012, 54 (11) :1202-1214
[8]  
Eclipse, 2016, ECL 4
[9]  
Fernandes E, 2016, P 20 INT C EV ASS SO
[10]   Identifying thresholds for object-oriented software metrics [J].
Ferreira, Kecia A. M. ;
Bigonha, Mariza A. S. ;
Bigonha, Roberto S. ;
Mendes, Luiz F. O. ;
Almeida, Heitor C. .
JOURNAL OF SYSTEMS AND SOFTWARE, 2012, 85 (02) :244-257