Balancing Consistency and Diversity in Automated C Code Generation for Software Defect Detectors
Machine learning (ML) techniques have gained traction in software bug detection. A persistent challenge in ML-based approaches arises from the imbalance between correct and incorrect training data. Specifically, there is a scarcity of incorrect data (containing bugs) compared to the abundance of correct data, degrading model performance. To mitigate this, researchers have proposed artificially injecting bugs into correct code to augment datasets. In addition to balancing data distribution, diversity in training examples significantly affects model performance. Programs written in high-level languages can exhibit a wide range of syntactic variations while maintaining identical functionality. Motivated by this observation, the objective of our research is to generate diverse incorrect examples stemming from a single root cause (i.e., a specific bug). Specifically, we plan to inject bugs into LLVM IR code and translate it into high-level source code using a probabilistic language model. In this paper, we present a preparatory step toward that goal: the generation of correct, bug-free examples using an IR-to-C translator based on a sequence-to-sequence (seq2seq) architecture. We investigate the resulting consistency and diversity of the generated correct examples by training the model on real-world software code.
Authors
- Mamoru Ohara
- Chisato Murakami (ORCID: https://orcid.org/0000-0002-3517-1657)
- Yuto Sugawa
Institutions
- Nihon University (JP)
- Toho University (JP)
- Tokyo Metropolitan Industrial Technology Research Institute (JP)
Publication Details
- Journal
- International Journal of Reliability Quality and Safety Engineering
- Published
- 2026-05-21
- DOI
- https://doi.org/10.1142/s0218539326500282
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00