Domain Adaptation for Code Model-based Unit Test Case Generation
Not on the map. Why?
Abstract (arXiv)
Recently, deep learning-based test case generation approaches have been proposed to automate the generation of unit test cases. In this study, we leverage Transformer-based code models to generate unit tests with the help of Domain Adaptation (DA) at a project level. Specifically, we use CodeT5, a relatively small language model trained on source code data, and fine-tune it on the test generation task. Then, we apply domain adaptation to each target project data to learn project-specific knowledge (project-level DA). We use the Methods2test dataset to fine-tune CodeT5 for the test generation task and the Defects4j dataset for project-level domain adaptation and evaluation. We compare our approach with (a) CodeT5 fine-tuned on the test generation without DA, (b) the A3Test tool, and (c) GPT-4 on five projects from the Defects4j dataset. The results show that tests generated using DA can increase the line coverage by 18.62%, 19.88%, and 18.02% and mutation score by 16.45%, 16.01%, and 12.99% compared to the above (a), (b), and (c) baselines, respectively. The overall results show consistent improvements in metrics such as parse rate, compile rate, BLEU, and CodeBLEU. In addition, we show that our approach can be seen as a complementary solution alongside existing search-based test generation tools such as EvoSuite, to increase the overall coverage and mutation scores with an average of 34.42% and 6.8%, for line coverage and mutation score, respectively.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 15 of its 53 references that are in the map. First posted on arXiv 15 Aug 2023.
Builds on
15 of 53 references.
References · 15
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2020A Brief Review of Domain Adaptationcited by 287
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2023No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generationcited by 82
- 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
- 2020On Learning Meaningful Assert Statements for Unit Test Casescited by 42
- 2023Learning Deep Semantics for Test Completioncited by 31
Built on by
Citing papers per year: 2023: 1; 2024: 2; 2025: 2; 2026: 2.
7 papers.
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 8
- 2024Retrieval-Augmented Test Generation: How Far Are We?cited by 7
- 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesiscited by 4
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
- 2026Compiling Large Multi-Modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven Perspectivecited by 1
- 2026Evaluating and Mitigating the Misguidance Effect of Buggy Code in LLM-Generated Unit Testscited by 0
- 2026Evaluating and Mitigating the Misguidance Effect of Buggy Code in LLM-Generated Unit Tests24 Jul 2026
- 2026Compiling Large Multi-Modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven Perspective14 Feb 2026
- 2025Nexus: Execution-Grounded Multi-Agent Test Oracle Synthesis30 Oct 2025
- 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generation3 Jun 2025
- 2024Retrieval-Augmented Test Generation: How Far Are We?19 Sep 2024
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsification14 Apr 2024
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023