Software Metrics vs. Code Text: Feature Representations for ML- and DL-Based Vulnerability Detection


Creative Commons License

Tarakcı İ., Nazlıoğlu S.

10th International Conference on Computer Science and Engineering (UBMK), İstanbul, Türkiye, 17 - 21 Eylül 2025, ss.709-714, (Tam Metin Bildiri)

Özet

This study evaluates traditional Machine Learning (ML) and Deep Learning (DL) models for software vulnerability detection using two feature representations: software metrics and raw source code text. Experiments focus on C/C++ vulnerabilities using Array Usage and Arithmetic Expression datasets. We assess how vectorization techniques (CountVectorizer, TF-IDF, and Word2Vec) affect the performance of Random Forest and K-Nearest Neighbors (ML models), and Multi-Layer Perceptron and Long Short-Term Memory (DL models) when applied to text-based code. Experiments on both balanced and imbalanced datasets across multiple vulnerability types reveal that representation choice significantly i nfluences model performance. Deep learning models perform better with code text, while traditional machine learning models benefit from software metrics. Vectorization strategy also impacts results, particularly for text-based inputs. Furthermore, class imbalance notably affects model behavior. These findings offer practical insights into how feature representation, model architecture, pre-processing, and data balance affect the effectiveness of automated vulnerability detection.