Deep Learning Powered Software Bug Prediction using CNN and LSTM Hybrid Architecture
Keywords:
Code analysis, Deep learning, Intelligent bug detection, CNN–LSTM, Software Defect prediction, Software quality assuranceAbstract
The rapid growth of modern software applications has significantly increased the complexity of software systems. As projects become larger and more sophisticated, identifying defects in source code has become a major challenge for developers and software engineers. Early detection of software bugs is essential because it helps reduce development costs, improves system reliability, and ensures better software quality. Traditional defect prediction approaches mainly rely on manually designed code metrics and rule-based analysis techniques. Although these methods can identify certain types of errors, they often fail to capture deeper structural and contextual relationships within the code. To address these limitations, this study introduces DeepGuard AI, an intelligent defect prediction framework based on a hybrid deep learning architecture that combines Convolutional Neural Networks (CNN) and Long Short-Term Memory (LSTM) networks. The proposed system is designed to automatically learn meaningful patterns from raw source code without relying solely on manually defined features. The framework includes multiple stages such as data preprocessing, tokenization, embedding, feature extraction, sequential modeling, classification, and result visualization. By integrating these components into a single pipeline, the system can support efficient and accurate bug prediction. Experimental results indicate that the proposed model achieves better predictive performance than several traditional machine learning approaches used in software defect prediction.
References
Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, May 2015.
I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. Cambridge, MA, USA: MIT Press, 2016.
S. Wang, T. Liu, and L. Tan, “Automatically learning semantic features for defect prediction,” in Proceedings of the 38th International Conference on Software Engineering, May 2016, pp. 297–308.
Y. Lee, S. Lee, C. G. Lee, I. Yeom, and H. Woo, “Continual prediction of bug-fix time using deep learning-based activity stream embedding,” IEEE Access, vol. 8, pp. 10503–10515, Jan. 2020.
L. Munkhdalai, T. Munkhdalai, K. H. Park, H. G. Lee, M. Li, and K. H. Ryu, “Mixture of activation functions with extended min–max normalization for forex market prediction,” IEEE Access, vol. 7, pp. 183680–183691, Dec. 2019.
Y. Huang, C. Qiu, X. Wang, S. Wang, and K. Yuan, “A compact convolutional neural network for surface defect inspection,” Sensors, vol. 20, no. 7, p. 1974, Apr. 2020.
X. Yang, D. Lo, X. Xia, Y. Zhang, and J. Sun, “Deep learning for just-in-time defect prediction,” in Proceedings of the IEEE International Conference on Software Quality, Reliability and Security, Aug. 2015, pp. 17–26.
Z. Li, T. Li, Y. Wu, L. Yang, H. Miao, and D. Wang, “Software defect prediction based on hybrid swarm intelligence and deep learning,” Computational Intelligence and Neuroscience, vol. 2021, Article ID 4997459, 2021.
Z. Xu, S. Li, Y. Tang, X. Luo, T. Zhang, J. Liu, and J. Xu, “Cross version defect prediction with representative data via sparse subset selection,” in Proceedings of the 26th Conference on Program Comprehension, May 2018, pp. 132–143.
S. Tang, S. Huang, C. Zheng, E. Liu, C. Zong, and Y. Ding, “A novel cross-project software defect prediction algorithm based on transfer learning,” Tsinghua Science and Technology, vol. 27, no. 1, pp. 41–57, Aug. 2021.
A. Zaim, J. Ahmad, N. H. Zakaria, G. E. Su, and H. Amnur, “Software defect prediction framework using hybrid software metric,” International Journal on Informatics Visualization, vol. 6, no. 4, pp. 921–930, Dec. 2022.
T. Lei, J. Xue, Y. Wang, Z. Niu, Z. Shi, and Y. Zhang, “WCM-WTrA: A cross-project defect prediction method based on feature selection and distance-weight transfer learning,” Chinese Journal of Electronics, vol. 31, no. 2, pp. 354–366, Mar. 2022.
H. Qing, L. Biwen, S. Beijun, and Y. Xia, “Cross-project software defect prediction using feature-based transfer learning,” in Proceedings of the Asia-Pacific Symposium on Internetware, Nov. 2015, pp. 74–82.
Y. Zhao, Y. Wang, Y. Zhang, D. Zhang, Y. Gong, and D. Jin, “ST-TLF: Cross-version defect prediction framework based on transfer learning,” Information and Software Technology, vol. 149, p. 106939, Sep. 2022.
A. Vaswani et al., “Attention is all you need,” in Advances in Neural Information Processing Systems, vol. 30, 2017.
S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, Nov. 1997.
K. Srinivas et al., “Deep ensemble optimal classifier-based software defect prediction for early detection and quality assurance,” Journal of Umm Al-Qura University for Engineering and Architecture, vol. 16, no. 4, pp. 1057–1068, Dec. 2025.
M. Yousef et al., “BeGrading: Large language models for enhanced feedback in programming education,” Neural Computing and Applications, vol. 37, no. 2, pp. 1027–1040, Jan. 2025.
Y. Bengio, A. Courville, and P. Vincent, “Representation learning: A review and new perspectives,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp. 1798–1828, Aug. 2013.
A. Soliman, S. Shaheen, and M. Hadhoud, “Leveraging pre-trained language models for code generation,” Complex & Intelligent Systems, vol. 10, no. 3, pp. 3955–3980, Jun. 2024.