Cargando…
Fine-Grained Software Defect Prediction Based on the Method-Call Sequence
Currently, software defect-prediction technology is being extensively researched in the design of metrics. However, the research objects are mainly limited to coarse-grained entities such as classes, files, and packages, and there is a wide range of defects that are difficult to predict in actual si...
Autores principales: | , , , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
Hindawi
2022
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9365544/ https://www.ncbi.nlm.nih.gov/pubmed/35965753 http://dx.doi.org/10.1155/2022/4311548 |
_version_ | 1784765361221009408 |
---|---|
author | Yang, Fengyu Huang, Yaxuan Xu, Haoming Xiao, Peng Zheng, Wei |
author_facet | Yang, Fengyu Huang, Yaxuan Xu, Haoming Xiao, Peng Zheng, Wei |
author_sort | Yang, Fengyu |
collection | PubMed |
description | Currently, software defect-prediction technology is being extensively researched in the design of metrics. However, the research objects are mainly limited to coarse-grained entities such as classes, files, and packages, and there is a wide range of defects that are difficult to predict in actual situations. To further explore the information between sequences of method calls and to learn the code semantics and syntactic structure between methods, we generated a method-call sequence that retains the code context structure information and the token sequence representing semantic information. We embedded the token sequence into the method-call sequence and encoded it into a fixed-length real-valued vector. We then built a defect-prediction model based on the transformer, which maps the code-vector representation containing the method-call sequences to a low-dimensional vector space to generate semantic features and syntactic structure features and also predicts the defect density of the method-call sequence. We conducted experiments on 10 open-source projects using the ELFF dataset. The experimental results show that the method-call sequence-level prediction effect is better than the class-level effect, and the prediction results are more stable than those of the method level. The mean absolute error (MAE) value of our approach was 8% lower than that of the other deep-learning methods. |
format | Online Article Text |
id | pubmed-9365544 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2022 |
publisher | Hindawi |
record_format | MEDLINE/PubMed |
spelling | pubmed-93655442022-08-11 Fine-Grained Software Defect Prediction Based on the Method-Call Sequence Yang, Fengyu Huang, Yaxuan Xu, Haoming Xiao, Peng Zheng, Wei Comput Intell Neurosci Research Article Currently, software defect-prediction technology is being extensively researched in the design of metrics. However, the research objects are mainly limited to coarse-grained entities such as classes, files, and packages, and there is a wide range of defects that are difficult to predict in actual situations. To further explore the information between sequences of method calls and to learn the code semantics and syntactic structure between methods, we generated a method-call sequence that retains the code context structure information and the token sequence representing semantic information. We embedded the token sequence into the method-call sequence and encoded it into a fixed-length real-valued vector. We then built a defect-prediction model based on the transformer, which maps the code-vector representation containing the method-call sequences to a low-dimensional vector space to generate semantic features and syntactic structure features and also predicts the defect density of the method-call sequence. We conducted experiments on 10 open-source projects using the ELFF dataset. The experimental results show that the method-call sequence-level prediction effect is better than the class-level effect, and the prediction results are more stable than those of the method level. The mean absolute error (MAE) value of our approach was 8% lower than that of the other deep-learning methods. Hindawi 2022-08-03 /pmc/articles/PMC9365544/ /pubmed/35965753 http://dx.doi.org/10.1155/2022/4311548 Text en Copyright © 2022 Fengyu Yang et al. https://creativecommons.org/licenses/by/4.0/This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. |
spellingShingle | Research Article Yang, Fengyu Huang, Yaxuan Xu, Haoming Xiao, Peng Zheng, Wei Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title | Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title_full | Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title_fullStr | Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title_full_unstemmed | Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title_short | Fine-Grained Software Defect Prediction Based on the Method-Call Sequence |
title_sort | fine-grained software defect prediction based on the method-call sequence |
topic | Research Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9365544/ https://www.ncbi.nlm.nih.gov/pubmed/35965753 http://dx.doi.org/10.1155/2022/4311548 |
work_keys_str_mv | AT yangfengyu finegrainedsoftwaredefectpredictionbasedonthemethodcallsequence AT huangyaxuan finegrainedsoftwaredefectpredictionbasedonthemethodcallsequence AT xuhaoming finegrainedsoftwaredefectpredictionbasedonthemethodcallsequence AT xiaopeng finegrainedsoftwaredefectpredictionbasedonthemethodcallsequence AT zhengwei finegrainedsoftwaredefectpredictionbasedonthemethodcallsequence |