The reviewed record of science sign in
Pith

arxiv: 2009.05617 · v2 · pith:2PKGYHEB · submitted 2020-09-11 · cs.SE · cs.CL· cs.LG

Unit Test Case Generation with Transformers and Focal Context

Reviewed by Pith T0 review T1 audit T2 compute T3 formal T4 kernel pith:2PKGYHEBrecord.jsonopen to challenge →

classification cs.SE cs.CLcs.LG
keywords testfocalcasesunitcasemethodsathenatestcontext
0
0 comments X
read the original abstract

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.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 15 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Sakura: An Approach for Generating Complex Tests from Natural Language Test Descriptions

    cs.SE 2026-05 unverdicted novelty 7.0

    Sakura is a multi-agent system that generates structurally complex tests from NL descriptions, achieving 50-78% higher compilability and 38-66% higher coverage overlap than baselines on 1,464 scenarios from 20 Apache ...

  2. From Exploration to Specification: LLM-Based Property Generation for Mobile App Testing

    cs.SE 2026-04 unverdicted novelty 7.0

    PropGen automates property generation for Android app testing via LLM synthesis from guided exploration and feedback refinement, yielding 912 valid properties and 25 previously unknown bugs across 12 apps.

  3. An Iterative Test-and-Repair Framework for Competitive Code Generation

    cs.SE 2026-04 unverdicted novelty 7.0

    FixAudit improves LLM code generation on competitive programming benchmarks by training a shared model for iterative code-aware test generation and repair, achieving 35%+ gains in Pass@1 over baselines on the same 7B model.

  4. CodeT: Code Generation with Generated Tests

    cs.CL 2022-07 conditional novelty 7.0

    CodeT improves code generation accuracy by using the same model to create test cases and then selecting solutions via output agreement on those tests, raising HumanEval pass@1 from 47% to 65.8%.

  5. FeedbackLLM: Metadata driven Multi-Agentic Language Agnostic Test Case Generator with Evolving prompt and Coverage Feedback

    cs.SE 2026-05 unverdicted novelty 6.0

    FeedbackLLM uses line and branch coverage feedback agents in an iterative multi-agent process with a redundancy cache to generate test cases achieving higher coverage than baselines on standard C and Python benchmarks...

  6. Generalizing Test Cases for Comprehensive Test Scenario Coverage

    cs.SE 2026-04 unverdicted novelty 6.0

    TestGeneralizer generalizes an initial test into a set of executable tests covering more diverse scenarios, delivering +31.66% mutation-based and +23.08% LLM-assessed scenario coverage gains over ChatTester on 12 open...

  7. Enhancing Program Repair with Specification Guidance and Intermediate Behavioral Signals

    cs.SE 2026-04 unverdicted novelty 6.0

    SpecTune improves LLM-based automated program repair by deriving localized postconditions at execution checkpoints and using alpha and beta signals to produce precise fault-localization and patch-generation guidance.

  8. TestDecision: Sequential Test Suite Generation via Greedy Optimization and Reinforcement Learning

    cs.SE 2026-04 unverdicted novelty 6.0

    By proving test suite coverage is monotone submodular and training LLMs with RL to maximize marginal gains, TestDecision improves branch coverage 38-52% and bug detection up to 95% over base models on ULT and LiveCodeBench.

  9. Generating Project-Specific Test Cases with Requirement Validation Intention

    cs.SE 2025-07 unverdicted novelty 6.0

    IntentionTest retrieves a reusable test from the project and edits it with an LLM to match a supplied validation intention, yielding tests that kill 28.1-37.6% more mutants, share 16.9-23.9% more coverage, and produce...

  10. Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback

    cs.SE 2025-06 unverdicted novelty 6.0

    PGS generates property-oriented, structurally minimal feedback from high-level program properties to refine LLM code, yielding up to 13.4% pass@1 gains and 1.4-1.6x higher bug-fix rates than prior TDD and debugging baselines.

  11. CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation

    cs.SE 2021-02 unverdicted novelty 6.0

    CodeXGLUE supplies a standardized collection of 10 code-related tasks, 14 datasets, an evaluation platform, and BERT-, GPT-, and encoder-decoder-style baselines.

  12. Leveraging Large Language Models to Obscure Code Stylometry: A Comparative Study of GPT-3.5 and GPT-4

    cs.SE 2026-06 unverdicted novelty 5.0

    GPT models with structured prompts can obscure code stylometry to varying degrees, but often at the cost of code functionality.

  13. PPO guided Agentic Pipeline for Adaptive Prompt Selection and Test Case Generation

    cs.SE 2026-05 unverdicted novelty 5.0

    PPO-LLM adaptively selects among eight prompting techniques using an 11-dimensional state vector to guide an LLM toward higher branch and line coverage than static baselines on 20 benchmark programs.

  14. StarCoder: may the source be with you!

    cs.CL 2023-05 accept novelty 5.0

    StarCoderBase matches or beats OpenAI's code-cushman-001 on multi-language code benchmarks; the Python-fine-tuned StarCoder reaches 40% pass@1 on HumanEval while retaining other-language performance.

  15. CodePori: Large-Scale System for Autonomous Software Development Using Multi-Agent Technology

    cs.SE 2024-02 unverdicted novelty 4.0

    CodePori is a multi-agent LLM system for code generation whose participant evaluation identifies practical challenges like memory limits and hallucinations missed by binary benchmarks.