CPTCP: Incorporating Convolutional Neural Network into Text-Vector Based Test Case Prioritization for Compilers

Published: 2025, Last Modified: 07 Jan 2026ICIC (10) 2025EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: Test case prioritization aims to schedule the execution order of test cases so as to detect bugs as early as possible. Currently, many important embedded systems rely on outdated compilers, which necessitates rigorous testing to ensure software quality. Traditional fuzzing test is time-consuming. To accelerate compiler testing, it is necessary to prioritize compiler test cases. However, existing methods largely depend on the test code and additional information generated by CSmith, and do not adequately address the impact of code size differences on the effectiveness of prioritization. Additionally, some methods require significant computational resources for feature extraction, which limits their practical applicability. This paper proposes a compiler test case prioritization method based on convolutional neural networks and text vectors, called CPTCP (Code Pixelization for Test Cases Prioritization). This method extracts features at the line level, merges them into a matrix, and then converts them into a pixel image for CNN training. The training data includes C code that can trigger bugs from different compiler versions. It predicts the potential of new test code to trigger bugs, thereby determining its priority. This method is suitable for test code from various sources and has low hardware requirements. Evaluation on five versions of GCC shows that CPTCP is effective in test case prioritization. In GCC 4.9.0 and 6.0.0, compared to existing methods, the actual runtime of the code that triggers the same number of compiler defects in tests was reduced by 88.01% and 77.34% respectively.
Loading