mlsanityData to 14 Oct 2026

Revisiting and Improving Retrieval-Augmented Deep Assertion Generation

arXiv 2309.10264 ↗First posted 19 Sep 2023cs.SEcited by 5

On the map: Retrieval-augmented generation → RAG pipeline design and evaluation

Abstract (arXiv)

Unit testing validates the correctness of the unit under test and has become an essential activity in software development process. A unit test consists of a test prefix that drives the unit under test into a particular state, and a test oracle (e.g., assertion), which specifies the behavior in that state. To reduce manual efforts in conducting unit testing, Yu et al. proposed an integrated approach (integration for short), combining information retrieval (IR) with a deep learning-based approach, to generate assertions for a unit test. Despite promising, there is still a knowledge gap as to why or where integration works or does not work. In this paper, we describe an in-depth analysis of the effectiveness of integration. Our analysis shows that: 1) The overall performance of integration is mainly due to its success in retrieving assertions. 2) integration struggles to understand the semantic differences between the retrieved focal-test (focal-test includes a test prefix and a unit under test) and the input focal-test; 3) integration is limited to specific types of edit operations and cannot handle token addition or deletion. To improve the effectiveness of assertion generation, this paper proposes a novel retrieve-and-edit approach named EditAS. Specifically, EditAS first retrieves a similar focal-test from a pre-defined corpus and treats its assertion as a prototype. Then, EditAS reuses the information in the prototype and edits the prototype automatically. EditAS is more generalizable than integration. We conduct experiments on two large-scale datasets and experimental results demonstrate that EditAS outperforms the state-of-the-art approaches, with an average improvement of 10.00%-87.48% and 3.30%-42.65% in accuracy and BLEU score, respectively.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 16 of its 51 references that are in the map. First posted on arXiv 19 Sep 2023.

Builds on

16 of 51 references.

References · 16

  1. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  2. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
  3. 2018Learning Word Vectors for 157 Languagescited by 280
  4. 2017Regularizing and Optimizing LSTM Language Modelscited by 205
  5. 2014Recurrent Neural Network Regularizationcited by 189
  6. 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
  7. 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
  8. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
  9. 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
  10. 2023A Survey of Learning-based Automated Program Repaircited by 55
  11. 2020On Learning Meaningful Assert Statements for Unit Test Casescited by 42
  12. 2016Deep API Learningcited by 41
4 more
  1. 2020Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformerscited by 30
  2. 2022Using Transfer Learning for Code-Related Taskscited by 18
  3. 2023EditSum: A Retrieve-and-Edit Framework for Source Code Summarizationcited by 18
  4. 2018Learning to Generate Corrective Patches using Neural Machine Translationcited by 10

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 3; 2026: 1.

5 papers.

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. 2026Enhancing Large Language Models with Retrieval Augmented Generation for Software Testing and Inspection Automation
  4. 2025AugmenTest: Enhancing Tests with LLM-Driven Oracles
  5. 2026Synthesizing File-Level Data for Unit Test Generation with Chain-of-Thoughts via Self-Debugging
  6. 2024Large-scale, Independent and Comprehensive study of the power of LLMs for test case generation
  7. 2024Chat-like Asserts Prediction with the Support of Large Language Model ↗
  8. 2026Correct Tests Are Not Enough: Measuring and Training Oracle Conversion in Specification-Based Test Generation ↗