Leveraging GraphCodeBERT for Enhanced Bug Prediction and Code Quality Analysis in Software Development Using Machine Learning

Chaitanya Vasamsetty, Bhavya Kadiyala, Karthick. M · International Journal of Multidisciplinary Research and Explorer · 2022

Bug prediction and code quality analysis are two crucial elements of software design with direct impact on maintainability and reliability of software. Traditional methods fail as they rely on manual inspection and infrequent feature extraction mechanisms. This paper presents a machine learning framework employing GraphCodeBERT—a programming language-specific transformer—towards enhancing the precision of bug detection and semantic source code analysis. By combining code embeddings with graph structures like Abstract Syntax Trees and Control Flow Graph, the model encapsulates both syntactic and semantic structure in code. The method involves pre-processing phases such as text cleaning, tokenization, and feature vector generation, resulting in classification by a softmax-based prediction model. Experimental comparisons to Logistic Regression, SVM, CNN, and baseline models indicate higher performance in accuracy (97.6%), precision (95.3%), recall (96.8%), and F1 score (96%). The results support GraphCodeBERT's effectiveness in offering robust and scalable solutions to bug prediction and code quality enhancement.

Read the paper · More papers on PaperTik