mlsanityData to 14 Oct 2026

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

arXiv 2503.20576 ↗First posted 26 Mar 2025cs.SE cs.CL cs.LGcited by 7

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

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.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 17 of its 49 references that are in the map. First posted on arXiv 26 Mar 2025.

Builds on

17 of 49 references.

References · 17

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215
  2. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  3. 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
  4. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
  5. 2024M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillationcited by 1,073
  6. 2024RAFT: Adapting Language Model to Domain Specific RAGcited by 262
  7. 2024Direct Language Model Alignment from Online AI Feedbackcited by 260
  8. 2024NV-Retriever: Improving text embedding models with effective hard-negative miningcited by 84
  9. 2024DebugBench: Evaluating Debugging Capability of Large Language Modelscited by 76
  10. 2023Learning to Retrieve In-Context Examples for Large Language Modelscited by 60
  11. 2020RepBERT: Contextualized Text Embeddings for First-Stage Retrievalcited by 46
  12. 2024TESTEVAL: Benchmarking Large Language Models for Test Case Generationcited by 40
5 more
  1. 2024SimRAG: Self-Improving Retrieval-Augmented Generation for Adapting Large Language Models to Specialized Domainscited by 28
  2. 2024Understand What LLM Needs: Dual Preference Alignment for Retrieval-Augmented Generationcited by 27
  3. 2024Kolb-Based Experiential Learning for Generalist Agents with Human-Level Kaggle Data Science Performancecited by 25
  4. 2024Repetition Neurons: How Do Language Models Produce Repetitions?cited by 23
  5. 2019Detection of a Source Code Plagiarism in a Student Programming Competitioncited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 5; 2026: 2.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Test Case Generation from Bug Reports via Large Language Models: A Cognitive Layered Evaluation Framework
  2. 2026CodeContests-O: Powering LLMs via Feedback-Driven Iterative Test Case Generation
  3. 2025CodeContests+: High-Quality Test Case Generation for Competitive Programming
  4. 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancement
  5. 2025Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy
  6. 2026TextBFGS: A Case-Based Reasoning Approach to Code Optimization via Error-Operator Retrieval
  7. 2025A General Retrieval-Augmented Generation Framework for Multimodal Case-Based Reasoning Applications
  8. 2025Can LLMs Generate Reliable Test Case Generators? A Study on Competition-Level Programming Problems