Cargando…

On the adequacy of static analysis warnings with respect to code smell prediction

Code smells are poor implementation choices that developers apply while evolving source code and that affect program maintainability. Multiple automated code smell detectors have been proposed: while most of them relied on heuristics applied over software metrics, a recent trend concerns the definit...

Descripción completa

Detalles Bibliográficos
Autores principales: Pecorelli, Fabiano, Lujan, Savanna, Lenarduzzi, Valentina, Palomba, Fabio, De Lucia, Andrea
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Springer US 2022
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8930969/
https://www.ncbi.nlm.nih.gov/pubmed/35370447
http://dx.doi.org/10.1007/s10664-022-10126-5
_version_ 1784671152718741504
author Pecorelli, Fabiano
Lujan, Savanna
Lenarduzzi, Valentina
Palomba, Fabio
De Lucia, Andrea
author_facet Pecorelli, Fabiano
Lujan, Savanna
Lenarduzzi, Valentina
Palomba, Fabio
De Lucia, Andrea
author_sort Pecorelli, Fabiano
collection PubMed
description Code smells are poor implementation choices that developers apply while evolving source code and that affect program maintainability. Multiple automated code smell detectors have been proposed: while most of them relied on heuristics applied over software metrics, a recent trend concerns the definition of machine learning techniques. However, machine learning-based code smell detectors still suffer from low accuracy: one of the causes is the lack of adequate features to feed machine learners. In this paper, we face this issue by investigating the role of static analysis warnings generated by three state-of-the-art tools to be used as features of machine learning models for the detection of seven code smell types. We conduct a three-step study in which we (1) verify the relation between static analysis warnings and code smells and the potential predictive power of these warnings; (2) build code smell prediction models exploiting and combining the most relevant features coming from the first analysis; (3) compare and combine the performance of the best code smell prediction model with the one achieved by a state of the art approach. The results reveal the low performance of the models exploiting static analysis warnings alone, while we observe significant improvements when combining the warnings with additional code metrics. Nonetheless, we still find that the best model does not perform better than a random model, hence leaving open the challenges related to the definition of ad-hoc features for code smell prediction.
format Online
Article
Text
id pubmed-8930969
institution National Center for Biotechnology Information
language English
publishDate 2022
publisher Springer US
record_format MEDLINE/PubMed
spelling pubmed-89309692022-04-01 On the adequacy of static analysis warnings with respect to code smell prediction Pecorelli, Fabiano Lujan, Savanna Lenarduzzi, Valentina Palomba, Fabio De Lucia, Andrea Empir Softw Eng Article Code smells are poor implementation choices that developers apply while evolving source code and that affect program maintainability. Multiple automated code smell detectors have been proposed: while most of them relied on heuristics applied over software metrics, a recent trend concerns the definition of machine learning techniques. However, machine learning-based code smell detectors still suffer from low accuracy: one of the causes is the lack of adequate features to feed machine learners. In this paper, we face this issue by investigating the role of static analysis warnings generated by three state-of-the-art tools to be used as features of machine learning models for the detection of seven code smell types. We conduct a three-step study in which we (1) verify the relation between static analysis warnings and code smells and the potential predictive power of these warnings; (2) build code smell prediction models exploiting and combining the most relevant features coming from the first analysis; (3) compare and combine the performance of the best code smell prediction model with the one achieved by a state of the art approach. The results reveal the low performance of the models exploiting static analysis warnings alone, while we observe significant improvements when combining the warnings with additional code metrics. Nonetheless, we still find that the best model does not perform better than a random model, hence leaving open the challenges related to the definition of ad-hoc features for code smell prediction. Springer US 2022-03-17 2022 /pmc/articles/PMC8930969/ /pubmed/35370447 http://dx.doi.org/10.1007/s10664-022-10126-5 Text en © The Author(s) 2022 https://creativecommons.org/licenses/by/4.0/Open AccessThis article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ (https://creativecommons.org/licenses/by/4.0/) .
spellingShingle Article
Pecorelli, Fabiano
Lujan, Savanna
Lenarduzzi, Valentina
Palomba, Fabio
De Lucia, Andrea
On the adequacy of static analysis warnings with respect to code smell prediction
title On the adequacy of static analysis warnings with respect to code smell prediction
title_full On the adequacy of static analysis warnings with respect to code smell prediction
title_fullStr On the adequacy of static analysis warnings with respect to code smell prediction
title_full_unstemmed On the adequacy of static analysis warnings with respect to code smell prediction
title_short On the adequacy of static analysis warnings with respect to code smell prediction
title_sort on the adequacy of static analysis warnings with respect to code smell prediction
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8930969/
https://www.ncbi.nlm.nih.gov/pubmed/35370447
http://dx.doi.org/10.1007/s10664-022-10126-5
work_keys_str_mv AT pecorellifabiano ontheadequacyofstaticanalysiswarningswithrespecttocodesmellprediction
AT lujansavanna ontheadequacyofstaticanalysiswarningswithrespecttocodesmellprediction
AT lenarduzzivalentina ontheadequacyofstaticanalysiswarningswithrespecttocodesmellprediction
AT palombafabio ontheadequacyofstaticanalysiswarningswithrespecttocodesmellprediction
AT deluciaandrea ontheadequacyofstaticanalysiswarningswithrespecttocodesmellprediction