Enhancing Code Quality: A CNN-Based Approach for Readability Classification and Bug Localization in Programming
Rolando B. Barrameda, Melvin A. Ballera · Advances in transdisciplinary engineering · 2025
Programming education faces significant challenges related to code readability and bug localization, which affect both student comprehension and software quality. Traditional approaches rely on simplistic metrics or manual assessments that do not scale well with increasing code complexity. The study explores the integration of deep learning, highlighting the role of Convolutional Neural Networks (CNNs), enhanced with a hybrid activation function combining Rectified Linear Unit (ReLU) and Leaky ReLU, to automate code readability classification and bug localization. The CNN processes structured code representations derived from lexical and syntactic analysis, enabling hierarchical feature extraction indicative of code quality. Experiments using open-source datasets, relevant to first- and second-year computer science students at De La Salle University-Dasmarinas, yielded a classification accuracy of 82.4%. The findings demonstrate potential for enhancing programming education by providing timely automated feedback and supporting instructors in scalable code evaluation. Challenges such as overfitting and computational complexity are discussed, along with recommendations for future research and curriculum integration.