UCL Discovery
UCL home » Library Services » Electronic resources » UCL Discovery

Optimizing Case-Based Reasoning System for Functional Test Script Generation with Large Language Models

Guo, S; Liu, H; Chen, X; Xie, Y; Zhang, L; Han, T; Chen, H; ... Wang, J; + view all (2025) Optimizing Case-Based Reasoning System for Functional Test Script Generation with Large Language Models. In: Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. (pp. pp. 4487-4498). ACM: New York, USA. Green open access

[thumbnail of 2503.20576v2.pdf]
Preview
PDF
2503.20576v2.pdf - Accepted Version

Download (1MB) | Preview

Abstract

In this work, we explore the potential of large language models (LLMs) for generating functional test scripts, which necessitates understanding the dynamically evolving code structure of the target software. To achieve this, we propose a case-based reasoning (CBR) system utilizing a 4R cycle (i.e., retrieve, reuse, revise, and retain), which maintains and leverages a case bank of test intent descriptions and corresponding test scripts to facilitate LLMs for test script generation. To improve user experience further, we introduce Re4, an optimization method for the CBR system, comprising reranking-based retrieval finetuning and reinforced reuse finetuning. Specifically, we first identify positive examples with high semantic and script similarity, providing reliable pseudo-labels for finetuning the retriever model without costly labeling. Then, we apply supervised finetuning, followed by a reinforcement learning finetuning stage, to align LLMs with our production scenarios, ensuring the faithful reuse of retrieved cases. Extensive experimental results on two product development units from Huawei Datacom demonstrate the superiority of the proposed CBR+Re4. Notably, we also show that the proposed Re4 method can help alleviate the repetitive generation issues with LLMs.

Type: Proceedings paper
Title: Optimizing Case-Based Reasoning System for Functional Test Script Generation with Large Language Models
Event: KDD '25
Open access status: An open access version is available from UCL Discovery
DOI: 10.1145/3711896.3737254
Publisher version: https://doi.org/10.1145/3711896.3737254
Language: English
Additional information: This version is the author accepted manuscript. For information on re-use, please refer to the publisher’s terms and conditions.
Keywords: Case-Based Reasoning; Large Language Model; Test Script Generation; Functional Testing; Reinforcement Learning
UCL classification: UCL
UCL > Provost and Vice Provost Offices > UCL BEAMS
UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science
URI: https://discovery.ucl.ac.uk/id/eprint/10213367
Downloads since deposit
0Downloads
Download activity - last month
Download activity - last 12 months
Downloads by country - last 12 months

Archive Staff Only

View Item View Item