基于大语言模型的组件化工业软件系统测试用例生成方法

    A Method for Generating Test Cases for Component-based Industrial Software Systems Based on Large Language Models

    • 摘要: 近年来,随着软件复杂度的增加,传统的手动和部分自动化测试方法难以应对系统测试工作的效率需求,尤其在应对快速变化和高度定制的工业软件系统时,测试覆盖率和效率往往不足。为此,本文提出了一种基于大语言模型的组件化工业软件系统测试用例生成方法,旨在提高测试工作的灵活性和效率。该方法采用大语言模型将用户描述转化为测试用例,结合分步生成策略,涵盖测试用例生成、修正及测试代码生成三个步骤。首先,系统从用户输入开始,结合知识库生成初步测试用例数据。随后,利用Petri网模型对生成的测试用例路径进行修正,确保测试流程的准确性。最后,通过模块化生成核心业务代码,加速测试用例的部署。实验结果表明,该方法在组件化工业软件系统测试中展现了良好的自动化能力,显著提升了测试效率和覆盖率。

       

      Abstract: In recent years, with the increasing complexity of software, traditional manual and partially automated testing methods have found it difficult to meet the efficiency requirements of system testing work, especially when dealing with rapidly changing and highly customized industrial software systems, where testing coverage and efficiency are often insufficient. Therefore, in this research, a component-based industrial software system test case generation method is proposed based on a large language model, aiming to improve the flexibility and efficiency of testing work. This method uses a large language model to convert user descriptions into test cases, combined with a step-by-step generation strategy, covering three stages: test case generation, correction, and test code generation. Firstly, the system starts from user input and generates preliminary test case data based on the knowledge base. Subsequently, the Petri net model is used to modify the generated test case paths to ensure the accuracy of the testing process. Finally, by modularizing the generation of core business code, the deployment of test cases can be accelerated. The experimental results show that this method demonstrates good automation capabilities in component-based industrial software system testing, significantly improving testing efficiency and coverage.

       

    /

    返回文章
    返回