Skip to main content

Software Defect Prediction Using Abstract Syntax Trees Features and Object—Oriented Metrics

  • Chapter
  • First Online:
Reliability Engineering for Industrial Processes

Part of the book series: Springer Series in Reliability Engineering ((RELIABILITY))

  • 45 Accesses

Abstract

Bug prediction systems have developed to assist developers in prioritizing testing tasks as software releases become more frequent due to changing requirements. Previous studies used methods such as classifying modules as faulty or not, or performing multi-class classification to predict the number of bugs. Some studies used Object-Oriented (OO) metrics, while others used Abstract Syntax Trees (ASTs) to extract code features for bug prediction. This research treated bug prediction as a regression problem and used deep learning models, such as LSTM and CNN, to solve it. The study compared the results of LSTM and CNN models trained on OO metrics with classical machine learning models and a multilayer perceptron model, and found that their LSTM model performed better in terms of MAE and MRE than three of the classical models. The LSTM and CNN models were also trained on features extracted from file-level ASTs of the source code of projects and compared with the models trained on OO metrics. The CNN model trained on file-level AST features produced MAE results similar to the LSTM model trained on OO metrics, but outperformed it in terms of MRE.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 149.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 199.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Software engineering book tenth edition. Ian Sommerville

    Google Scholar 

  2. Tang MH, Kao MH, Chen MH (1999) An empirical study on object-oriented metrics. In: IEEE computer, proceedings on software metrics symposium, pp 242–249

    Google Scholar 

  3. Pandey SK, Tripathi AK (2020) BCV-predictor: a bug count vector predictor of a successive version of the software system. Knowl Based Syst 197:105924. ISSN 0950-7051. https://doi.org/10.1016/j.knosys.2020.105924. https://www.sciencedirect.com/science/article/pii/S0950705120302604

  4. Pan L, Lu J, Xu L, Gao (2019) An improved CNN model for within-project software defect prediction. Appl Sci 9:2138. https://doi.org/10.3390/app9102138

  5. Pachouly J, Ahirrao S, Kotecha K, Selvachandran G, Abraham A (2022) A systematic literature review on software defect prediction using artificial intelligence: datasets, data validation methods, approaches, and tools. Eng Appl Artif Intell 111:104773

    Article  Google Scholar 

  6. Chidamber SR, Kemerer CF (1993) A metrics suite for object oriented design. M.I.T. Sloan School of Management E53–315

    Google Scholar 

  7. Henderson-Sellers B (1996) Object-oriented metrics: measures of complexity. Prentice-Hall, pp 142–147

    Google Scholar 

  8. Martin RC (2002) Agile software development: principles, patterns, and practices. Alant Apt Series. Prentice Hall, Upper Saddle River, NJ, USA

    Google Scholar 

  9. Goyal PK, Joshi G (2014) QMOOD metric sets to assess quality of Java program. In: 2014 international conference on issues and challenges in intelligent computing techniques (ICICT), pp 520–533. https://doi.org/10.1109/ICICICT.2014.6781337

  10. Yang X, Wen W (2018) Ridge and Lasso regression models for cross-version defect prediction. IEEE Trans Reliab 67(3):885–896

    Article  Google Scholar 

  11. Nevendra M, Singh P (2019) Software bug count prediction via AdaBoost.R-ET. In: 2019 IEEE 9th international conference on advanced computing (IACC), pp 7–12. https://doi.org/10.1109/IACC48062.2019.8971588

  12. Yu L (2012) Using negative binomial regression analysis to predict software faults: a study of apache ant. IJ Inf Technol Comput Sci 4(8):63–70

    Google Scholar 

  13. Rathore SS, Kumar S (2016) A decision tree regression based approach for the number of software faults prediction. SIGSOFT Softw Eng Notes 41(1):1–6. https://doi.org/10.1145/2853073.2853083

  14. Dam H, Pham T, Ng S, Tran T, Grundy J, Ghose A, Kim T, Kim C-J (2018) A deep tree-based model for software defect prediction

    Google Scholar 

  15. Dam HK, Tran T, Pham T, Ng SW, Grundy J, Ghose A (2021) Automatic feature learning for predicting vulnerable software components. IEEE Trans Softw Eng 47(1):67–85. https://doi.org/10.1109/TSE.2018.2881961

  16. Akimova E, Bersenev A, Deikov A, Kobylkin K, Konygin A, Mezentsev I, Misilov V (2021) A survey on software defect prediction using deep learning. Mathematics 9:1180. https://doi.org/10.3390/math9111180

    Article  Google Scholar 

  17. White M, Vendome C, Linares-Vasquez M, Poshyvanyk D (2015) Toward deep learning software repositories. In: Proceedings of the 2015 IEEE/ACM 12th working conference on mining software repositories (MSR), Florence, Italy, 16–17 May 2015, pp 334–345

    Google Scholar 

  18. Fan G, Diao X, Yu H, Yang K, Chen L (2019) Software defect prediction via attention-based recurrent neural network. Sci Program 2019:1–14. https://doi.org/10.1155/2019/6230953

    Article  Google Scholar 

  19. Fang D, Liu S, Liu A (2022) Gated homogeneous fusion networks with jointed feature extraction for defect prediction. IEEE Trans Reliab 71(2):512–526. https://doi.org/10.1109/TR.2022.3165115

    Article  Google Scholar 

  20. Liu J, Ai J, Lu M, Wang J, Shi H (2023) Semantic feature learning for software defect prediction from source code and external knowledge. J Syst Softw 111753

    Google Scholar 

  21. Xu J, Ai J, Liu J, Shi T (2022) ACGDP: an augmented code graph-based system for software defect prediction. IEEE Trans Reliab 71(2):850–864. https://doi.org/10.1109/TR.2022.3161581

    Article  Google Scholar 

  22. Nevendra M, Singh P (2022) A survey of software defect prediction based on deep learning. Arch Computat Methods Eng 29:5723–5748. https://doi.org/10.1007/s11831-022-09787-8

  23. Malhotra R, Singh P (2023) Recent advances in deep learning models: a systematic literature review. Multimed Tools Appl. https://doi.org/10.1007/s11042-023-15295-z

    Article  Google Scholar 

  24. Li J, He P, Zhu J, Lyu MR (2017) Software defect prediction via convolutional neural network. In: Proceedings of the 2017 IEEE international conference on software quality, reliability and security (QRS), Prague, Czech Republic, 25–29 July 2017, pp 318–328

    Google Scholar 

  25. Li J, He P, Zhu J, Lyu MR (2017) Software defect prediction via convolutional neural network. In: 2017 IEEE international conference on software quality, reliability and security (QRS), pp 318–328. https://doi.org/10.1109/QRS.2017.42

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Aseem Sangalay .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Sethi, A., Sangalay, A., Malhotra, R. (2024). Software Defect Prediction Using Abstract Syntax Trees Features and Object—Oriented Metrics. In: Kapur, P.K., Pham, H., Singh, G., Kumar, V. (eds) Reliability Engineering for Industrial Processes. Springer Series in Reliability Engineering. Springer, Cham. https://doi.org/10.1007/978-3-031-55048-5_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-55048-5_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-55047-8

  • Online ISBN: 978-3-031-55048-5

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics