Promptstratégiák hatása a nagy nyelvi modellek programkód-tesztelési képességére
The Impact of Prompting Strategies on the Test Case Generation Capabilities of Large Language Models
Keywords:
large language models, prompt engineering, test case generation, software testing, test design techniques, /, nagy nyelvi modellek, prompttervezés, teszteset-generálás, szoftvertesztelés, teszttervezési technikákAbstract
This paper investigates the effect of different prompting strategies on the quality of program tests gen-erated by large language models. In the experiment, test cases were generated for JavaScript pro-gramming tasks using three prompts with different levels of detail. The evaluation was based on fault detection rate, executability, size, and efficiency of the generated test suites. The results show that, for the examined tasks, more detailed prompts produced larger test suites but did not improve fault-detection capability, while the executability of the generated test suites was lower than with the basic prompt.
Kivonat
A cikk különböző promptstratégiák hatását vizsgálja a nagy nyelvi modellek által generált program-tesztek minőségére. A kísérletben JavaScript-programozási feladathoz három, eltérő részletezettségű prompt segítségével készültek tesztesetek. Az értékelés a hibafeltárási arány, a tesztkészletek végrehajthatósága, mérete és hatékonysága alapján történt. Az eredmények azt mutatják, hogy a vizsgált feladatokon a részletesebb promptok több tesztesetet eredményeztek, azonban nem növelték a hibafeltárási képességet, és a generált tesztkészletek végrehajthatósága is alacsonyabb volt az egyszerű alap-prompthoz képest.
References
[1] Alshahwan N., Chheda J., Finogenova A., Gokkaya B., Harman M., Harper I., Marginean A., Sengupta S., Wang E.: Automated Unit Test Improvement using Large Language Models at Meta. Companion Proceedings of the 32nd ACM International Conference on the Foundations of Software Engineering. ACM, 2024, 185–196.
[2] Lemieux C., Inala J. P., Lahiri S. K., Sen S.: CodaMOSA: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models. 45th IEEE/ACM International Conference on Software Engineering, (ICSE). IEEE, 2023, 919–931.
[3] Moradi Dakhel A., Nikanjam A., Majdinasab V., Khomh F., Desmarais M. C.: Effective test generation using pre-trained Large Language Models and mutation testing. Information and Software Technology. Elsevier, 2024, 171, 107468.
[4] Ouédraogo W. C., Kaboré A. K., Li Y., Tian H., Koyuncu A., Klein J., Lo D., Bissyandé T. F.: Prompt engineering in LLMs for automated unit test generation: A large-scale study. Empirical Software Engineering, Springer Nature, 2026, 31(4), 1–58.
[5] Rodríguez M., Rossi G., Fernandez A.: Evaluating Large Language Models for the Generation of Unit Tests with Equivalence Partitions and Boundary Values. In: Cloud Computing, Big Data and Emerging Topics, 13th Conference JCC-BD&ET 2025. Springer, 2025, 46–60.
[6] Ryan G., Jain S., Shang M., Wang S., Ma X., Ramanathan M. K., Ray B.: Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM. Proceedings of the ACM on Software Engineering. ACM, 2024, 1(FSE), 951–971.
[7] Schäfer M., Nadi S., Eghbali A., Tip F.: An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation. IEEE Transactions on Software Engineering. IEEE, 2024, 50(1), 85–105.
[8] Tufano M., Drain D., Svyatkovskiy A., Deng S. K., Sundaresan N.: Unit Test Case Generation with Transformers and Focal Context. arXiv preprint, 2020.
[9] Wang J., Huang Y., Chen C., Liu Z., Wang S., Wang Q.: Software Testing With Large Language Models: Survey, Landscape, and Vision. IEEE Transactions on Software Engineering. IEEE, 2024, 50(4), 911–936.
[10] Yuan Z., Liu M., Ding S., Wang K., Chen Y., Peng X., Lou Y.: Evaluating and Improving ChatGPT for Unit Test Generation. Proceedings of the ACM on Software Engineering. ACM, 2024, 1(FSE), 1703–1726.