mlsanityData to 7 Oct 2026

LSPRAG: LSP-Guided RAG for Language-Agnostic Real-Time Unit Test Generation

arXiv 2510.22210 ↗First posted 25 Oct 2025cs.SE cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

Automated unit test generation is essential for robust software development, yet existing approaches struggle to generalize across multiple programming languages and operate within real-time development. While Large Language Models (LLMs) offer a promising solution, their ability to generate high coverage test code depends on prompting a concise context of the focal method. Current solutions, such as Retrieval-Augmented Generation, either rely on imprecise similarity-based searches or demand the creation of costly, language-specific static analysis pipelines. To address this gap, we present LSPRAG, a framework for concise-context retrieval tailored for real-time, language-agnostic unit test generation. LSPRAG leverages off-the-shelf Language Server Protocol (LSP) back-ends to supply LLMs with precise symbol definitions and references in real time. By reusing mature LSP servers, LSPRAG provides an LLM with language-aware context retrieval, requiring minimal per-language engineering effort. We evaluated LSPRAG on open-source projects spanning Java, Go, and Python. Compared to the best performance of baselines, LSPRAG increased line coverage by up to 174.55% for Golang, 213.31% for Java, and 31.57% for Python.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 18 of its 69 references that are in the map. First posted on arXiv 25 Oct 2025.

Builds on

18 of 69 references.

References · 18

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  4. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  5. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 400
  6. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  7. 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 278
  8. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
  9. 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 92
  10. 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
  11. 2023Effective Test Generation Using Pre-trained Large Language Models and Mutation Testingcited by 51
  12. 2022Pynguin: Automated Unit Test Generation for Pythoncited by 49
6 more
  1. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  2. 2024HITS: High-coverage LLM-based Unit Test Generation via Method Slicingcited by 37
  3. 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generationcited by 17
  4. 2024On the Noise Robustness of In-Context Learning for Text Generationcited by 15
  5. 2024Leveraging Large Language Models for Enhancing the Understandability of Generated Unit Testscited by 11
  6. 2024TestSpark: IntelliJ IDEA's Ultimate Test Generation Companioncited by 9

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024LLM-based Unit Test Generation via Property Retrieval
  2. 2024Retrieval-Augmented Test Generation: How Far Are We?
  3. 2025AugmenTest: Enhancing Tests with LLM-Driven Oracles
  4. 2026LLM vs. Human Unit Tests: Fault Detection on Real Python Bugs
  5. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
  6. 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMs
  7. 2026Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automation
  8. 2025Go-UT-Bench: A Fine-Tuning Dataset for LLM-Based Unit Test Generation in Go