Automation of error detection in code using machine learning
Abstract
The objective of this study was to develop approaches for the automated detection of coding errors through machine learning algorithms. The research examined five primary approaches: classification using decision trees, sequence analysis with recurrent neural networks, anomaly detection through clustering algorithms, a generative approach with transformers, and deep learning using convolutional neural networks. Each approach was evaluated on a five-point scale based on a systematic analysis of advantages and disadvantages, considering performance metrics. The results included examples of the implementation of these approaches, an analysis of their strengths and weaknesses, and assessments of their effectiveness. Transformers demonstrated high accuracy in complex cases, effectively processing large volumes of data and identifying errors in intricate code structures. This approach received a rating of 5 due to its high accuracy and efficiency in handling large and complex datasets. Decision tree algorithms, despite their speed and simplicity, had limited effectiveness in largescale tasks, particularly for complex software structures. Meanwhile, clustering algorithms proved versatile in anomaly detection, though their accuracy depended on the correct selection of clustering parameters. These algorithms received a rating of 3 due to their limited effectiveness in complex tasks and scalability issues. The approach based on recurrent neural networks showed good results in sequence analysis but was sensitive to long sequences and the vanishing gradient effect, which reduced its accuracy. Convolutional neural networks efficiently handled visual representations of code but had limited capability in considering sequence context. Neural network-based approaches received a rating of 4, as they are effective in specific tasks but have limitations related to resource consumption and contextual analysis. Thus, the results confirmed that for automated error detection in large and complex programs, the most effective approach is the use of generative models, such as transformers, which can process substantial data volumes with high accuracy
Keywords
decision trees; sequence analysis; anomaly detection; generative transformers; clustering and classification algorithms; neural network applications
References
[1] Abed Alsaedi, S., Noaman, A.Y., Ahmed, A., & Eassa, F. (2023). Nature-based prediction model of bug reports based on ensemble machine learning model. IEEE Access, 11, 63916-63931. doi: 10.1109/ACCESS.2023.3288156.
[2] Aladics, T., Jász, J., & Ferenc, R. (2021). Bug prediction using source code embedding based on Doc2Vec. In O. Gervasi, B. Murgante, S. Misra, C. Garau, I. Blečić, D. Taniar, B.O. Apduhan, A. Rocha, E. Tarantino & C.M. Torre (Eds.), Computational science and its applications – ICCSA 2021 (pp. 382-397). Cham: Springer. doi: 10.1007/9783-030-87007-2_27.
[3] Albattah, W., & Alzahrani, M. (2024). Software defect prediction based on machine learning and deep learning techniques: An empirical approach. AI, 5(4),1743-1758. doi: 10.3390/ai5040086.
[4] Batchu, P., Gali, T.R., & Inturi, S. (2024). Python source code analysis for bug detection using transformers. Engineering and Technology Journal, 9(4), 3772-3777. doi: 10.47191/etj/v9i04.15.
[5] Chakraborty, P., Alfadel, M., & Nagappan, M. (2024). RLocator: Reinforcement learning for bug localization. IEEE Transactions on Software Engineering, 50(10), 2695-2708. doi: 10.1109/TSE.2024.3452595.
[6] Chatterjee, P., & Das, A. (2023). Leveraging machine learning for predictive bug analysis. International Journal of Scientific Research and Management, 12(12), 1804-1814. doi: 10.18535/ijsrm/v12i12.ec04.
[7] Chen, J., Xiang, H., Li, L., Zhang, Y., Ding, B., & Li, Q. (2024). Utilizing precise and complete code context to guide LLM in automatic false positive mitigation. Computer Science: Software Engineering, 1(1), article number arXiv:2411.03079. doi: 10.48550/arXiv.2411.03079.
[8] Fazal, F., & Farook, C. (2024). A machine learning approach for depression detection in Sinhala-English code-mixed. International Journal on Advances in ICT for Emerging Regions, 17(3), 102-112. doi: 10.4038/icter. v17i3.7282.
[9] Grytsiuk, P.Y., Sikora, L.S., & Hrytsiuk, Y.I. (2023). Problems of detecting and correcting errors in messages encoded by Fibonacci matrices. Scientific Bulletin of UNFU, 33(4), 45-58. doi: 10.36930/40330407.
[10] Harzevili, N.S., Shin, J., Wang, J., Wang, S., & Nagappan, N. (2023). Automatic static bug detection for machine learning libraries: Are we there yet? Computer Science: Software Engineering, article number arXiv:2307.04080. doi: 10.48550/arXiv.2307.04080.
[11] Himashree, S., Ajitha, S., Reshma, K.J., & Girish, R. (2024). Automating adverse event detection in clinical trials through machine learning. Periodico di Mineralogia, 93(6), 340-352. doi: 10.5281/zenodo.14282801.
[12] Kodamasimham, K., Murthy, P., & Sarangi, S. (2024). Exploring the synergy between generative ai and software engineering: Automating code optimization and bug fixing. World Journal of Advanced Engineering Technology and Sciences, 13(1), 682-691. doi: 10.30574/wjaets.2024.13.1.0464.
[13] Kumar, S.A., & Prasanna, B. (2024). Software bug prediction using machine learning. International Journal of Scientific Research in Engineering and Management, 8(4). doi: 10.55041/IJSREM31425
[14] Kumari, M., Singh, R., & Singh, V.B. (2024a). Prioritization of software bugs using entropy-based measures. Journal of Software: Evolution and Process, 37(2), article number e2742. doi: 10.1002/smr.2742.
[15] Kumari, N., Ahmed, J., Raghuwanshi, K.K., & Agarwal, P. (2024b). Automating bug triage: Unleashing the power of machine learning and natural language processing. doi: 10.21203/rs.3.rs-4294244/v1.
[16] Li, Z., Zhang, H., Jin, Z., & Li, G. (2023). WELL: Applying bug detectors to bug localization via weakly supervised learning. Journal of Software: Evolution and Process. doi: 10.22541/au.168810846.65018089/v1.
[17] Nadim, M., & Roy, B. (2022). Utilizing source code syntax patterns to detect bug inducing commits using machine learning models. Software Quality Journal, 31, 775-807. doi: 10.1007/s11219-022-09611-3.
[18] Nouwou Mindom, P.S., Da Silva, L., Nikanjam, A., & Khomh, F. (2024). Continuously learning bug locations. Computer Science: Software Engineering, article number arXiv:2412.11289. doi: 10.48550/arXiv.2412.11289.
[19] Pozharytska, O., & Troitskyi, K. (2021). Digital technologies for grammatical error correction: Deep learning methods & syntactic N-grams. Issues of Translation Studies and Language Teaching Methods, 35, 237-241. doi: 10.18524/2307-4558.2021.35.237789.
[20] Rehman, L., Iqbal, M.J., Ramzan, S., Nawaz, S., Jaffar, A., Yaqoob, S., & Ul Haq, I. (2023). Long-lived bugs prediction using machine learning approaches. Journal of Jilin University, Engineering and Technology Edition, 42(1), 76-97. doi: 10.17605/OSF.IO/T2Z75.
[21] Sarawan, K., Polpinij, J., & Luaphol, B. (2023). Machine learning-based methods for identifying bug severity level from bug reports. In P. Meesad, S. Sodsee, W. Jitsakul & S. Tangwannawit (Eds.), Proceedings of the 19th international conference on computing and information technology (pp. 199-208). Cham: Springer. doi: 10.1007/978-3-031-30474-3_17.
[22] Shah, M., Sharma, A., & Kumar, R. (2023). Software bugs detection using supervised machine learning techniques. Advances in Science and Technology, 124, 594-601. doi: 10.4028/p-of2831.
[23] Solitto Da Silva, A., Garcia, R.E., & Botega, L.C. (2023). Bug localization model in source code using ontologies. IEEE Access, 11, 98542-98557. doi: 10.1109/ACCESS.2023.3313598.
[24] Symala Sai Sree, M., Sai Deekshitha, P., Jhansi, P., & Alekya, R. (2024). Nature-based prediction model of bug reports based on ensemble machine learning model. Journal of Engineering Sciences, 230-240. doi: 10.36893/ JES.2024.V15I10.028.
[25] Wang, S., Zheng, H., Wen, X., Xu, K., & Tan, H. (2024). Enhancing chip design verification through AI-powered bug detection in RTL code. Applied and Computational Engineering, 92, 27-33. doi: 10.54254/27552721/92/20241685.
[26] Yanko, А., Prokudin, А., Fil, І., & Kruk, О. (2024). Detection of LDDoS attacks using SDN networks with machine learning elements. Measuring and Computing Devices in Technological Processes, 4, 287-296. doi: 10.31891/22199365-2024-80-36.
[27] Yi, L.T. (2024). Code smell detection using machine learning classification algorithm. International Journal of Research and Innovation in Social Science, 8(5), 889-900. doi: 10.47772/IJRISS.2024.805063.