arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.03641cs.SE
收藏

使用 LLM 从需求生成高层测试用例:一项行业研究

Generating High-Level Test Cases from Requirements using LLM: An Industry Study

Tokyo City University(东京城市大学);VeriServe Corporation(VeriServe公司)

Satoshi Masuda, Satoshi Kouzawa, Kyousuke Sezai, Hidetoshi Suhara, Yasuaki Hiruta, Kunihiro Kudou

AI总结:

本文提出一种无需 RAG、仅通过提示让 LLM 先识别测试设计技术再生成高层测试用例的方法,并在 Bluetooth 与 Mozilla 数据集上验证其语义相似性评估及工业可行性。

摘要:

当前,从需求文档生成以自然语言描述的高层测试用例是由人工完成的。在包括专门从事软件测试的公司在内的行业中,对使用大型语言模型(LLM)从需求文档自动生成高层测试用例存在显著需求。利用 LLM 进行需求分析的工作正在开展。在某些情况下,会采用检索增强生成(RAG)来使用 LLM 生成高层测试用例。然而,在实际应用中,需要针对每个具体应用的知识体系创建定制的 RAG,这非常耗费人力。此外,在将高层测试用例生成作为提示应用时,尚未建立一种在不使用 RAG 的情况下,以适用于其他规格说明的水平指导生成高层测试用例的方法。因此,需要建立一种可泛化到更广泛需求文档的高层测试用例自动生成方法。本文提出一种仅使用提示、无需创建 RAG 即可从需求文档生成高层(GHL)测试用例的方法。在所提方法中,首先将需求文档输入 LLM,以生成与该需求文档相对应的测试设计技术;随后,针对每一种生成的测试设计技术生成高层测试用例。此外,我们验证了一种基于所生成高层测试用例语义相似性的评估方法。实验中,我们使用同时具备需求文档和高层测试用例的 Bluetooth 和 Mozilla 数据集对该方法进行了确认,分别取得 0.81 和 0.37 的宏召回率测量结果。我们认为,该方法在不使用 RAG 生成高层测试用例方面具备实际应用可行性。

英文摘要:

Currently, generating high-level test cases described in natural language from requirement documents is performed manually. In the industry, including companies specializing in software testing, there is a significant demand for the automatic generation of high-level test cases from requirement documents using Large Language Models (LLMs). Efforts to utilize LLMs for requirement analysis are underway. In some cases, retrieval-augmented generation (RAG) is employed for generating high-level test cases using LLMs. However, in practical applications, it is necessary to create a RAG tailored to the knowledge system of each specific application, which is labor-intensive. Moreover, when applying high-level test case generation as a prompt, there is no established method for instructing the generation of high-level test cases at a level applicable to other specifications without using RAG. It is required to establish a method for the automatic generation of high-level test cases that can be generalized across a wider range of requirement documents. In this paper, we propose a method for generating high-level (GHL) test cases from requirement documents using only prompts, without creating RAGs. In the proposed method, first, the requirement document is input into the LLM to generate test design techniques corresponding to the requirement document. Then, high-level test cases are generated for each of the generated test design techniques. Furthermore, we verify an evaluation method based on semantic similarity of the generated high-level test cases. In the experiments, we confirmed the method using datasets from Bluetooth and Mozilla, where requirement documents and high-level test cases are available, achieving macro-recall measurement of 0.81 and 0.37, respectively. We believe that the method is feasible for practical application in generating high-level test cases without using RAG.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑