Large Language Model-Based Automatic Generation Method for Test Cases Across Multiple Programming Language Types
摘要
In the development and operation of blockchain systems, a substantial number of test cases are required to evaluate the system, involving extensive code. Manually writing these test cases for a new blockchain system can lead to significant repetitive work and is prone to errors. This paper proposes a method for automatically generating blockchain system test case code based on large language models (LLMs). This method leverages currently available open-source generative language models and utilizes blockchain test code data from GitHub to construct a vector database. Using the Retrieval-Augmented Generation (RAG) approach, it generates appropriate test cases based on the characteristics of the blockchain system under test. Experimental results demonstrate that this system can effectively produce complete and comprehensive blockchain test code.