DOAJ Open Access 2026

Hallucination-Reduced and Robust Accuracy Unit Test Generation

Metin Deder Simay Sahin Merve Yilmazer Mehmet Karaköse

Abstrak

Automated unit testing methods in the software development process are crucial for reducing costs, improving product quality, and ensuring system reliability. While current Large Language Models (LLMs) are highly successful in general-purpose code generation, they may fall short in ensuring structural integrity and producing executable code in industrial fields such as C++ and ROS 2, where memory management is critical and external dependencies are frequently used. The proposed method fills this gap by focusing not only on high-level languages, unlike existing studies in the literature, but also on industrial embedded system architectures. The proposed method developed in this study aims to create high-accuracy unit tests by reducing the hallucination rate for systems without existing test scope, and to develop systems with existing test scope using developer logic. Recently distinguished by its success in code generation, the 7-billion-parameter Qwen 2.5 Coder model was selected as the base model. A multilingual dataset consisting of over 13,000 unique code-test pairs was created to reduce the model's computational costs and improve test code generation speed. The model was trained using QLoRA (Quantized Low-Rank Adaptation) and LLM fine-tuning methods. The proposed method has contributed to time savings and increased efficiency by accelerating test code generation speed by approximately 4 times compared to existing cloud-based approaches. Furthermore, unlike functionality-focused black-box testing and raw text-based approaches in the literature, the model's understanding of the project context is ensured by using Abstract Syntax Trees (AST), and the hallucination problem is significantly reduced by employing white-box and structural testing principles that examine the internal structure and dependencies of the source code. The proposed method addresses the limitations of leveraging large language models when generating unit test code and the key points in producing effective unit test code for industrial applications.

Penulis (4)

M

Metin Deder

S

Simay Sahin

M

Merve Yilmazer

M

Mehmet Karaköse

Format Sitasi

Deder, M., Sahin, S., Yilmazer, M., Karaköse, M. (2026). Hallucination-Reduced and Robust Accuracy Unit Test Generation. https://ijmada.com/index.php/ijmada/article/view/125

Akses Cepat

PDF tidak tersedia langsung

Cek di sumber asli →
Lihat di Sumber
Informasi Jurnal
Tahun Terbit
2026
Sumber Database
DOAJ
Akses
Open Access ✓