Design-sensitive metric thresholds based on design roles

Detalhes bibliográficos
Ano de defesa: 2021
Autor(a) principal: Dósea, Marcos Barbosa lattes
Outros Autores: Sant`Anna, Cláudio Nogueira
Orientador(a): Sant'Anna, Cláudio Nogueira lattes
Banca de defesa: Mendonça Neto, Manoel Gomes de lattes, Chavez , Christina von Flach Garcia lattes, Maia, Marcelo de Almeida lattes, Aniche, Maurício Finavaro lattes
Tipo de documento: Tese
Tipo de acesso: Acesso aberto
Idioma: por
eng
Instituição de defesa: Universidade Federal da Bahia
Programa de Pós-Graduação: Programa de Pós-Graduação em Ciência da Computação (PGCOMP) 
Departamento: Instituto de Matemática
País: Brasil
Palavras-chave em Português:
Área do conhecimento CNPq:
Link de acesso: https://repositorio.ufba.br/handle/ri/34683
Resumo: State-of-the-art techniques and Automated Static Analysis Tools (ASATs) for identifying code smells rely on metric-based assessment. However, most of these techniques have low accuracy. One possible reason is that source code elements, such as methods implemented according to different design decisions, are assessed through the same generic threshold for each metric. Other possible reason is that these metric thresholds are usually derived from classes driven by different design decisions. Using generic metric thresholds that do not consider the design context of each evaluated class can generate many false positives and false negatives for software developers. Our goal is to propose design-sensitive techniques to derive contextual metric thresholds. Our primary hypothesis is that using the design role played by each system class to define this context may point out more relevant code smells to software developers. We conducted some empirical studies to define the proposed techniques. Firstly, we performed a large-scale survey that showed that practitioners recognize difficulties in fitting ASATs into the software development process. They also claim that there is no routine for application. One possible reason practitioners recognize that most of these tools use a single metric threshold, which might not be adequate to evaluate all system classes. Secondly, we conducted an empirical study to investigate whether fine-grained design decisions also influence the distribution of software metrics and, therefore, should be considered to derive metric thresholds. Our findings show that the distribution of metrics is sensitive to the following design decisions: (i) design role of the class (ii) used libraries, (iii) coding style, (iv) exception handling, and (v) logging and debugging code mechanisms. We used these findings to propose two new techniques to derive design-sensitive metric thresholds using the class design role as context. Then, we carried out two large-scale empirical studies to evaluate them. The first study showed that our proposed techniques improved precision according to developers' perceptions. Since it is impossible and tiring to perform a complete source code quality assessment with developers, we conducted a second study mining the evolution of software projects from popular architectural domains. We found that our techniques improved recall to point out methods effectively refactored during software evolution.