HarnessLLM: Automatic Testing Harness Generation via Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
Existing LLM-based automatic test generation methods mainly produce input and expected output pairs to categorize the intended behavior of correct programs. Although straightforward, these methods have limited diversity in generated tests and cannot provide enough debugging information. We propose HarnessLLM, a two-stage training pipeline that enables LLMs to write harness code for testing. Particularly, LLMs generate code that synthesizes inputs and validates the observed outputs, allowing complex test cases and flexible output validation such as invariant checking. To achieve this, we train LLMs with SFT followed by RLVR with a customized reward design. Experiments show that HarnessLLM outperforms input-output-based testing in bug finding and testing strategy diversity. HarnessLLM further benefits the code generation performance through test-time scaling with our generated test cases as inference-phase validation. Our code is available at https://github.com/UCSB-NLP-Chang/HarnessLLM.git.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 28 of its 42 references that are in the map. First posted on arXiv 2 Nov 2025.
Builds on
28 of 42 references.
References · 28
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 1,980
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2025ThinkPrune: Pruning Long Chain-of-Thought of LLMs via Reinforcement Learningcited by 187
16 more
- 2025Competitive Programming with Large Reasoning Modelscited by 115
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
- 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
- 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesiscited by 89
- 2023No More Manual Tests? Evaluating and Improving ChatGPT for Unit Test Generationcited by 82
- 2025LeetCodeDataset: A Temporal Dataset for Robust Evaluation and Efficient Training of Code LLMscited by 67
- 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learningcited by 51
- 2023ALGO: Synthesizing Algorithmic Programs with LLM-Generated Oracle Verifierscited by 41
- 2025CodeContests+: High-Quality Test Case Generation for Competitive Programmingcited by 39
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generationcited by 34
- 2023Accelerating Reinforcement Learning of Robotic Manipulations via Feedback from Large Language Modelscited by 22
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verificationcited by 22
- 2023The Program Testing Ability of Large Language Models for Codecited by 11
- 2024ArchCode: Incorporating Software Requirements in Code Generation with Large Language Modelscited by 8
- 2025Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creationcited by 5
- 2025Collision- and Reachability-Aware Multi-Robot Control with Grounded LLM Plannerscited by 4
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation
- 2026Complex Agents, Shallow Tests: Demystifying and Enhancing Test Adequacy of Agent Harness in the Wild
- 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
- 2026TTHE: Test-Time Harness Evolution
- 2026GRPO with State Mutations: Improving LLM-Based Hardware Test Plan Generation
- 2026MIST-RL: Mutation-based Incremental Suite Testing via Reinforcement Learning
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generation