Automatic Unit Test Code Generation Using Large Language Models

被引:0
|
作者
Ocal, Akdeniz Kutay [1 ]
Keskinoz, Mehmet [1 ]
机构
[1] Istanbul Tech Univ, Bilgisayar Muhendisligi Bolumu, Istanbul, Turkiye
关键词
software testing; unit test generation; large language models; automatic test generation;
D O I
10.1109/SIU61531.2024.10600772
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
This study aimed to automate the production of unit tests, a critical component of the software development process. By using pre-trained Large Language Models, manual effort and training costs were reduced, and test production capacity was increased. Instead of directly feeding the test functions obtained from the Java projects to be tested into the model, the project was analyzed to extract additional information. The data obtained from this analysis were used to create an effective prompt template. Furthermore, the sources of the problematic tests produced were identified, and this information was fed back into the model, enabling it to autonomously correct the errors. The results of the study showed that the model was able to generate tests covering %55.58 of the functions collected from Java projects across different domains and that re-feeding the model with the generated erroneous tests resulted in a %29.3 improvement in the number of executable tests.
引用
收藏
页数:4
相关论文
共 50 条
  • [21] GREEN-CODE: Optimizing Energy Efficiency in Large Language Models for Code Generation
    Ilager, Shashikant
    Briem, Lukas Florian
    Brandic, Ivona
    arXiv,
  • [22] A Large Scale Study On the Effectiveness of Manual and Automatic Unit Test Generation
    Souza, Beatriz
    Machado, Patricia
    34TH BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING, SBES 2020, 2020, : 253 - 262
  • [23] Automating Patch Set Generation from Code Review Comments Using Large Language Models
    Rahman, Tajmilur
    Singh, Rahul
    Sultan, Mir Yousuf
    PROCEEDINGS 2024 IEEE/ACM 3RD INTERNATIONAL CONFERENCE ON AI ENGINEERING-SOFTWARE ENGINEERING FOR AI, CAIN 2024, 2024, : 273 - 274
  • [24] ARCHCODE: Incorporating Software Requirements in Code Generation with Large Language Models
    Han, Hojae
    Kim, Jaejin
    Yoo, Jaeseok
    Lee, Youngwon
    Hwang, Seung-won
    PROCEEDINGS OF THE 62ND ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, VOL 1: LONG PAPERS, 2024, : 13520 - 13552
  • [25] Harnessing the Power of Large Language Models for Automated Code Generation and Verification
    Antero, Unai
    Blanco, Francisco
    Onativia, Jon
    Salle, Damien
    Sierra, Basilio
    ROBOTICS, 2024, 13 (09)
  • [26] Benchmarking Large Language Models for Automated Verilog RTL Code Generation
    Thakur, Shailja
    Ahmad, Baleegh
    Fan, Zhenxing
    Pearce, Hammond
    Tan, Benjamin
    Karri, Ramesh
    Dolan-Gavitt, Brendan
    Garg, Siddharth
    2023 DESIGN, AUTOMATION & TEST IN EUROPE CONFERENCE & EXHIBITION, DATE, 2023,
  • [27] On the Effectiveness of Large Language Models in Domain-Specific Code Generation
    Gu, Xiaodong
    Chen, Meng
    Lin, Yalan
    Hu, Yuhan
    Zhang, Hongyu
    Wan, Chengcheng
    Wei, Zhao
    Xu, Yong
    Wang, Juhong
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (03)
  • [28] Multi-stage guided code generation for Large Language Models
    Han, Yewei
    Lyu, Chen
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2025, 139
  • [29] Investigating large language models capabilities for automatic code repair in Python']Python
    Omari, Safwan
    Basnet, Kshitiz
    Wardat, Mohammad
    CLUSTER COMPUTING-THE JOURNAL OF NETWORKS SOFTWARE TOOLS AND APPLICATIONS, 2024, 27 (08): : 10717 - 10731
  • [30] Automatic Kernel Generation for Large Language Models on Deep Learning Accelerators
    Wang, Fuyu
    Shen, Minghua
    2023 IEEE/ACM INTERNATIONAL CONFERENCE ON COMPUTER AIDED DESIGN, ICCAD, 2023,