mlsanityData to 7 Oct 2026

Unit Test Case Generation with Transformers and Focal Context

arXiv 2009.05617 ↗First posted 11 Sep 2020cs.SE cs.CL cs.LGcited by 118

Not on the map. Why?

Cited by 21 in LLM agents and tool use, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

Automated unit test case generation tools facilitate test-driven development and support developers by suggesting tests intended to identify flaws in their code. Existing approaches are usually guided by the test coverage criteria, generating synthetic test cases that are often difficult for developers to read or understand. In this paper we propose AthenaTest, an approach that aims to generate unit test cases by learning from real-world focal methods and developer-written testcases. We formulate unit test case generation as a sequence-to-sequence learning task, adopting a two-step training procedure consisting of denoising pretraining on a large unsupervised Java corpus, and supervised finetuning for a downstream translation task of generating unit tests. We investigate the impact of natural language and source code pretraining, as well as the focal context information surrounding the focal method. Both techniques provide improvements in terms of validation loss, with pretraining yielding 25% relative improvement and focal context providing additional 11.1% improvement. We also introduce Methods2Test, the largest publicly available supervised parallel corpus of unit test case methods and corresponding focal methods in Java, which comprises 780K test cases mined from 91K open-source repositories from GitHub. We evaluate AthenaTest on five defects4j projects, generating 25K passing test cases covering 43.7% of the focal methods with only 30 attempts. We execute the test cases, collect test coverage information, and compare them with test cases generated by EvoSuite and GPT-3, finding that our approach outperforms GPT-3 and has comparable coverage w.r.t. EvoSuite. Finally, we survey professional developers on their preference in terms of readability, understandability, and testing effectiveness of the generated tests, showing overwhelmingly preference towards AthenaTest.

Key facts. Cited by 118 papers in the map (data through 7 Oct 2026). First posted on arXiv 11 Sep 2020.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 5; 2022: 8; 2023: 24; 2024: 31; 2025: 28; 2026: 22.

118 papers.

Sort:

By area:

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  3. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  4. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  5. 2022CodeT: Code Generation with Generated Testscited by 369
  6. 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 228
  7. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
  8. 2023Planning with Large Language Models for Code Generationcited by 179
  9. 2023SantaCoder: don't reach for the stars!cited by 169
  10. 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 132
  11. 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agentscited by 129
  12. 2023Learning Performance-Improving Code Editscited by 103
38 more
  1. 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
  2. 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 85
  3. 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
  4. 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
  5. 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
  6. 2023Using Large Language Models to Generate JUnit Tests: An Empirical Studycited by 53
  7. 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
  8. 2024The Limits of Inference Scaling Through Resamplingcited by 51
  9. 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learningcited by 51
  10. 2022Interactive Code Generation via Test-Driven User-Intent Formalizationcited by 50
  11. 2022Investigating Explainability of Generative AI for Code through Scenario-based Designcited by 47
  12. 2024CoverUp: Effective High Coverage Test Generation for Pythoncited by 36
  13. 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?cited by 32
  14. 2023Learning Deep Semantics for Test Completioncited by 31
  15. 2023CAT-LM: Training Language Models on Aligned Code And Testscited by 28
  16. 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancementcited by 27
  17. 2024HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agentcited by 24
  18. 2024CodeBenchGen: Creating Scalable Execution-based Code Generation Benchmarkscited by 23
  19. 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 21
  20. 2024CodePori: Large-Scale System for Autonomous Software Development Using Multi-Agent Technologycited by 21
  21. 2024Can Large Language Models Serve as Data Analysts? A Multi-Agent Assisted Approach for Qualitative Data Analysiscited by 20
  22. 2023Augmenting Greybox Fuzzing with Generative AIcited by 18
  23. 2023LLM4VV: Developing LLM-Driven Testsuite for Compiler Validationcited by 15
  24. 2023RAPGen: An Approach for Fixing Code Inefficiencies in Zero-Shotcited by 14
  25. 2024Rocks Coding, Not Development--A Human-Centric, Experimental Evaluation of LLM-Supported SE Taskscited by 13
  26. 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
  27. 2023The Program Testing Ability of Large Language Models for Codecited by 11
  28. 2024Leveraging Large Language Models for Preliminary Security Risk Analysis: A Mission-Critical Case Studycited by 10
  29. 2024B4: Towards Optimal Assessment of Plausible Code Solutions with Plausible Testscited by 9
  30. 2024Measuring the Influence of Incorrect Code on Test Generationcited by 9
  31. 2025LLM Test Generation via Iterative Hybrid Program Analysiscited by 9
  32. 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-trainingcited by 8
  33. 2024CATCODER: Repository-Level Code Generation with Relevant Code and Type Contextcited by 8
  34. 2024PLUM: Improving Code LMs with Execution-Guided On-Policy Preference Learning Driven By Synthetic Test Casescited by 8
  35. 2024A System for Automated Unit Test Generation Using Large Language Models and Assessment of Generated Test Suitescited by 8
  36. 2025TestForge: Feedback-Driven, Agentic Test Suite Generationcited by 8
  37. 2025Hallucination to Consensus: Multi-Agent LLMs for End-to-End JUnit Test Generationcited by 8
  38. 2025SemAgent: A Semantics Aware Program Repair Agentcited by 8

50 most cited of 118 All 118 (JSON)