C Programming Code Defect Detection based on Bounded Model Checking
Junan Chen · 2025
In recent years, programming languages of computer systems access memory management to low-level hardware defects. Detecting defects to prevent security vulnerabilities, system crashes and performance issues is crucial for code analysis tools. Hence, this research proposes C Bounded Model Checker (CBMC) for C programs to enable formal verification of bound properties such as array bounds violations, overflows, and pointer safety. Initially, GNU compiler collection (GCC) bug dataset is used to report detailed descriptions and code snippets for understanding defects in C program. After that, preprocessing step includes removing comments and unnecessary whitespaces to avoid defects using Regular Expressions (Regex). Then, for feature extraction Abstract Syntax Tree (AST) is used for syntax-based features and Control Flow Graph (CFG) is utilized for semantic-based features. Finally, for verification CBMC model is used to convert code of C programming by checking program correctly within specified constraints by detecting errors, bugs and generating output. The proposed CBMC achieved better results in terms of accuracy (84.39%), precision (30.93%) and recall (60.92%) when compared to existing Vulnerability Bidirectional Encoder Representations from Transformers-Convolutional Neural Network (VulBERTa-CNN).