Cargando…

Attention based GRU-LSTM for software defect prediction

Software defect prediction (SDP) can be used to produce reliable, high-quality software. The current SDP is practiced on program granular components (such as file level, class level, or function level), which cannot accurately predict failures. To solve this problem, we propose a new framework calle...

Descripción completa

Detalles Bibliográficos
Autores principales: Munir, Hafiz Shahbaz, Ren, Shengbing, Mustafa, Mubashar, Siddique, Chaudry Naeem, Qayyum, Shazib
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Public Library of Science 2021
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7932164/
https://www.ncbi.nlm.nih.gov/pubmed/33661985
http://dx.doi.org/10.1371/journal.pone.0247444
_version_ 1783660425108258816
author Munir, Hafiz Shahbaz
Ren, Shengbing
Mustafa, Mubashar
Siddique, Chaudry Naeem
Qayyum, Shazib
author_facet Munir, Hafiz Shahbaz
Ren, Shengbing
Mustafa, Mubashar
Siddique, Chaudry Naeem
Qayyum, Shazib
author_sort Munir, Hafiz Shahbaz
collection PubMed
description Software defect prediction (SDP) can be used to produce reliable, high-quality software. The current SDP is practiced on program granular components (such as file level, class level, or function level), which cannot accurately predict failures. To solve this problem, we propose a new framework called DP-AGL, which uses attention-based GRU-LSTM for statement-level defect prediction. By using clang to build an abstract syntax tree (AST), we define a set of 32 statement-level metrics. We label each statement, then make a three-dimensional vector and apply it as an automatic learning model, and then use a gated recurrent unit (GRU) with a long short-term memory (LSTM). In addition, the Attention mechanism is used to generate important features and improve accuracy. To verify our experiments, we selected 119,989 C/C++ programs in Code4Bench. The benchmark tests cover various programs and variant sets written by thousands of programmers. As an evaluation standard, compared with the state evaluation method, the recall, precision, accuracy and F1 measurement of our well-trained DP-AGL under normal conditions have increased by 1%, 4%, 5%, and 2% respectively.
format Online
Article
Text
id pubmed-7932164
institution National Center for Biotechnology Information
language English
publishDate 2021
publisher Public Library of Science
record_format MEDLINE/PubMed
spelling pubmed-79321642021-03-15 Attention based GRU-LSTM for software defect prediction Munir, Hafiz Shahbaz Ren, Shengbing Mustafa, Mubashar Siddique, Chaudry Naeem Qayyum, Shazib PLoS One Research Article Software defect prediction (SDP) can be used to produce reliable, high-quality software. The current SDP is practiced on program granular components (such as file level, class level, or function level), which cannot accurately predict failures. To solve this problem, we propose a new framework called DP-AGL, which uses attention-based GRU-LSTM for statement-level defect prediction. By using clang to build an abstract syntax tree (AST), we define a set of 32 statement-level metrics. We label each statement, then make a three-dimensional vector and apply it as an automatic learning model, and then use a gated recurrent unit (GRU) with a long short-term memory (LSTM). In addition, the Attention mechanism is used to generate important features and improve accuracy. To verify our experiments, we selected 119,989 C/C++ programs in Code4Bench. The benchmark tests cover various programs and variant sets written by thousands of programmers. As an evaluation standard, compared with the state evaluation method, the recall, precision, accuracy and F1 measurement of our well-trained DP-AGL under normal conditions have increased by 1%, 4%, 5%, and 2% respectively. Public Library of Science 2021-03-04 /pmc/articles/PMC7932164/ /pubmed/33661985 http://dx.doi.org/10.1371/journal.pone.0247444 Text en © 2021 Munir et al http://creativecommons.org/licenses/by/4.0/ This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
spellingShingle Research Article
Munir, Hafiz Shahbaz
Ren, Shengbing
Mustafa, Mubashar
Siddique, Chaudry Naeem
Qayyum, Shazib
Attention based GRU-LSTM for software defect prediction
title Attention based GRU-LSTM for software defect prediction
title_full Attention based GRU-LSTM for software defect prediction
title_fullStr Attention based GRU-LSTM for software defect prediction
title_full_unstemmed Attention based GRU-LSTM for software defect prediction
title_short Attention based GRU-LSTM for software defect prediction
title_sort attention based gru-lstm for software defect prediction
topic Research Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7932164/
https://www.ncbi.nlm.nih.gov/pubmed/33661985
http://dx.doi.org/10.1371/journal.pone.0247444
work_keys_str_mv AT munirhafizshahbaz attentionbasedgrulstmforsoftwaredefectprediction
AT renshengbing attentionbasedgrulstmforsoftwaredefectprediction
AT mustafamubashar attentionbasedgrulstmforsoftwaredefectprediction
AT siddiquechaudrynaeem attentionbasedgrulstmforsoftwaredefectprediction
AT qayyumshazib attentionbasedgrulstmforsoftwaredefectprediction