IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0247444.html
   My bibliography  Save this article

Attention based GRU-LSTM for software defect prediction

Author

Listed:
  • Hafiz Shahbaz Munir
  • Shengbing Ren
  • Mubashar Mustafa
  • Chaudry Naeem Siddique
  • Shazib Qayyum

Abstract

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.

Suggested Citation

  • Hafiz Shahbaz Munir & Shengbing Ren & Mubashar Mustafa & Chaudry Naeem Siddique & Shazib Qayyum, 2021. "Attention based GRU-LSTM for software defect prediction," PLOS ONE, Public Library of Science, vol. 16(3), pages 1-19, March.
  • Handle: RePEc:plo:pone00:0247444
    DOI: 10.1371/journal.pone.0247444
    as

    Download full text from publisher

    File URL: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0247444
    Download Restriction: no

    File URL: https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0247444&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pone.0247444?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Daren Zhao & Huiwu Zhang & Qing Cao & Zhiyi Wang & Sizhang He & Minghua Zhou & Ruihua Zhang, 2022. "The research of ARIMA, GM(1,1), and LSTM models for prediction of TB cases in China," PLOS ONE, Public Library of Science, vol. 17(2), pages 1-18, February.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pone00:0247444. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: plosone (email available below). General contact details of provider: https://journals.plos.org/plosone/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.