Automated Assertion Generation via Information Retrieval and Its Integration with Deep learning
Hao Yu, Yiling Lou, Ke Sun, Dezhi Ran, Tao Xie, Dan Hao, Ying Li, Ge Li, Qianxiang Wang
摘要
Unit testing could be used to validate the correctness of basic units of the software system under test. To reduce manual efforts in conducting unit testing, the research community has contributed with tools that automatically generate unit test cases, including test inputs and test oracles (e.g., assertions). Recently, ATLAS, a deep learning (DL) based approach, was proposed to generate assertions for a unit test based on other already written unit tests. Despite promising, the effectiveness of ATLAS is still limited. To improve the effectiveness, in this work, we make the first attempt to leverage Information Retrieval (IR) in assertion generation and propose an IR-based approach, including the technique of IR-based assertion retrieval and the technique of retrieved-assertion adaptation. In addition, we propose an integration approach to combine our IR-based approach with a DL-based approach (e.g., ATLAS) to further improve the effectiveness. Our experimental results show that our IR-based approach outperforms the state-of-the-art DL-based approach, and integrating our IR-based approach with the DL-based approach can further achieve higher accuracy. Our results convey an important message that information retrieval could be competitive and worthwhile to pursue for software engineering tasks such as assertion generation, and should be seriously considered by the research community given that in recent years deep learning solutions have been over-popularly adopted by the research community for software engineering tasks.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Retrieval Augmented Code Generation and Summarization 引用了 Retrieval-Augmented Generation for Code Summarization via Hybrid GNN
- Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code Models 引用了 On learning meaningful assert statements for unit test cases
- Validating the eBPF Verifier via State Embedding 引用了 On learning meaningful assert statements for unit test cases
- Domain Adaptation for Code Model-Based Unit Test Case Generation 引用了 On learning meaningful assert statements for unit test cases
- On the Evaluation of Large Language Models in Unit Test Generation 引用了 On learning meaningful assert statements for unit test cases
- On the Evaluation of Large Language Models in Unit Test Generation 引用了 Retrieval Augmented Code Generation and Summarization
- AGORA: Automated Generation of Test Oracles for REST APIs 引用了 On learning meaningful assert statements for unit test cases
引用它的顶会 Paper13
- On the Evaluation of Large Language Models in Unit Test GenerationLin Yang, Chen Yang, Shutao Gao, Weijing Wang 等ASE 2024 · 42 次引用
- Domain Adaptation for Code Model-Based Unit Test Case GenerationJiho Shin, Sepehr Hashtroudi, Hadi Hemmati, Song WangISSTA 2024 · 21 次引用
- Validating the eBPF Verifier via State EmbeddingHao Sun, Zhendong SuOSDI 2024 · 18 次引用
- Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code ModelsShuzheng Gao, Wenxin Mao, Cuiyun Gao, Li Li 等ICSE 2024 · 15 次引用
- AGORA: Automated Generation of Test Oracles for REST APIsJuan C. Alonso, Sergio Segura, Antonio Ruiz-CortésISSTA 2023 · 15 次引用
它引用的 Paper6
- Retrieval-Augmented Generation for Code Summarization via Hybrid GNNShangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow 等ICLR 2021 · 194 次引用
- Boosting coverage-based fault localization via graph-based representation learningYiling Lou, Qihao Zhu, Jinhao Dong, Xia Li 等FSE 2021 · 157 次引用
- Retrieval Augmented Code Generation and SummarizationMd. Rizwan Parvez, Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray 等EMNLP Findings 2021 · 141 次引用
- On learning meaningful assert statements for unit test casesCody Watson, Michele Tufano, Kevin Moran, Gabriele Bavota 等ICSE 2020 · 96 次引用
- Understanding build issue resolution in practice: symptoms and fix patternsYiling Lou, Zhenpeng Chen, Yanbin Cao, Dan Hao 等FSE 2020 · 39 次引用
相关 Paper
- Revisiting and Improving Retrieval-Augmented Deep Assertion GenerationWeifeng Sun, Hongyan Li, Meng Yan, Yan Lei 等ASE 2023 · 10 次引用
- An Empirical Study on Focal Methods in Deep-Learning-Based Approaches for Assertion GenerationYibo He, Jiaming Huang, Hao Yu, Tao XieFSE 2024 · 8 次引用
- Less Is More: On the Importance of Data Quality for Unit Test GenerationJunwei Zhang, Xing Hu, Shan Gao, Xin Xia 等FSE 2025 · 2 次引用
- What You See is What You Get: Attention-Based Self-Guided Automatic Unit Test GenerationXin Yin, Chao Ni, Xiaodan Xu, Xiaohu YangICSE 2025 · 8 次引用
- DeepTC-Enhancer: Improving the Readability of Automatically Generated TestsDevjeet Roy, Ziyi Zhang, Maggie Ma, Venera Arnaoudova 等ASE 2020 · 32 次引用
