Improving Retrieval-Augmented Deep Assertion Generation via Joint Training
Quanjun Zhang, Chunrong Fang, Yi Zheng, Ruixiang Qian, Shengcheng Yu,, Yuan Zhao, Jianyi Zhou, Yun Yang, Tao Zheng, Zhenyu Chen

TL;DR
This paper introduces AG-RAG, a retrieval-augmented assertion generation method that jointly trains retrieval and generation components using external codebases and advanced language models, significantly improving accuracy over prior approaches.
Contribution
The paper presents a novel joint training framework for assertion retrieval and generation, leveraging external codebases and CodeT5 to enhance assertion accuracy in unit testing.
Findings
AG-RAG outperforms six state-of-the-art approaches on multiple benchmarks.
It improves assertion accuracy by over 20% compared to the latest baseline.
AG-RAG generates more unique assertions than previous methods, with 3.45 to 9.20 times more unique assertions.
Abstract
Unit testing attempts to validate the correctness of basic units of the software system under test and has a crucial role in software development and testing. Very recent work proposes a retrieve-and-edit approach to generate unit test oracles, i.e., assertions. Despite being promising, it is still far from perfect due to some limitations, such as splitting assertion retrieval and generation into two separate components without benefiting each other. In this paper, we propose AG-RAG, a retrieval-augmented automated assertion generation approach that leverages external codebases and joint training to address various technical limitations of prior work. Inspired by the plastic surgery hypothesis, AG-RAG attempts to combine relevant unit tests and advanced pre-trained language models (PLMs) with retrieval-augmented fine-tuning. AG-RAG builds a dense retriever to search for relevant…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques
