Summary
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.
Agradecer não é, de modo algum, uma tarefa trivial. São tantas pessoas a agradecer que sempre se corre o risco de, equivocadamente, não se fazer devida menção a alguém. Então, objetivamente, começarei por agradecer a todos que de alguma forma me ajudaram, direta ou indiretamente. Assim, ninguém estará completamente esquecido. De forma especial, inicialmente, agradeço ao CEFET-MG e ao Departamento de Computação por terem concedido liberação das minhas atividades docentes para que eu pudesse me dedicar integralmente ao doutoramento. Ao Programa de Pós-Graduação em Ciência da Computação e à CAPES/CNPq pelo apoio financeiro. Aos funcionários da Secretaria do PPGCC, sempre prestativos e competentes. Aos amigos do LLP pelo companheirismo e amizade. Sentirei falta das agradáveis divagações diárias sobre os mais variados assuntos durante o almoço no "bandeco". Aos meus familiares pelo apoio incondicional e por estarem sempre ao meu lado, especialmente aos meus irmãos Leandro e Patrícia, à minha filha Amanda, à minha namorada Letícia, à minha avó Terezinha e aos meus tios Ronaldo e Neide. À Professora Mariza, minha coorientadora, pelas incontáveis contribuições para realização desse trabalho. Finalmente, agradeço especialmente ao Professor Marco Túlio, pela paciência, comprometimento, disponibilidade e dedicação. Um profissional exemplar. Um amigo por quem tenho eterna gratidão.
Design patterns are general reusable solutions to common recurring problems in software projects. These solutions, when correctly applied, are supposed to enhance modular and flexible structures in software. The aim of this work is to study the occurrences of God Class and Long Method bad smells in software systems developed with design patterns. To achieve this aim, we carried out a study with five Java project, in order to: (i) investigate if the use of GOF design patterns avoid the occurrences of the bad smells God Class and Long Method, (ii) identify co-occurrences of the GOF design patterns with these bad smells, and (iii) identify the main situations that lead software systems to present these co-occurrences. The results obtained suggest that Composite and Factory Method have a low co-occurrence with these bad smells, and Template Method and Observer have a high co-occurrence with God Class and Long Method, respectively. In addition, we have identified that the misuse of design patterns and the scattering and crosscutting concerns has contributed to the emergence of such co-occurrences.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.