arXiv AI

A Theoretical Analysis of Test-Driven Code Generation

The paper presents a probabilistic framework for two main test‑driven code generation paradigms: selecting code after generation using an execution environment, and generating code conditioned on environment feedback. It formalizes selection heuristics as environment‑aware estimators of code correctness, proving that fuzzy functional similarity estimators provide a stronger inductive bias and higher signal‑to‑noise ratio than functional equivalence estimators. Additionally, it models backprompting as an in‑context approximation of Thompson sampling, deriving a regret bound that explains its limitations due to ambiguous task descriptions, and validates these theoretical insights with experiments on seven open‑weight models across multiple benchmarks, including a new quantum programming benchmark.

arXiv Machine Learning
Oct 12

QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Code

QTestBench is a new framework that evaluates quantum code tests generated by large language models (LLMs) by comparing their verdicts against independent benchmark checkers, rather than treating the tests as ground truth. It prompts models to produce syntactic, semantic, and behavioral tests, injects candidate solutions at runtime, and assesses test quality across three validation cohorts. In benchmarks on PennyLane QHack challenges and Qiskit HumanEval tasks, generated test suites frequently execute but often fail to discriminate correct from faulty implementations, with the best test quality scores of 0.71 and 0.34 respectively.

By Meriem Terki, Nouhaila Innan, Minghao Shao, Muhammad Kashif, Alberto Marchisio, Muhammad Shafique
arXiv AI
Oct 12

SWE-Critix: Post-Training Generalist Verifiers for Assessing Coding-Agent Trajectories

SWE-Critix is a post‑training pipeline that creates generalist verifiers for coding‑agent trajectories. It uses supervised fine‑tuning followed by reinforcement learning to train 30B models on CodeForge‑Preview data, enabling the verifier to predict completion labels and generate natural‑language explanations. The approach raises classification accuracy from 57% to 78% on a held‑out test set.

By Jiajun Hu, Chun Yong Chong
arXiv AI
Oct 28

Benchmarking LLM Agents for Behaviorally Adequate Test Generation from Software Requirements

The paper introduces Req2Test-Bench, a benchmark of 5,086 instances linking natural‑language Gherkin requirements to developer‑written test implementations across five languages and four BDD frameworks. It evaluates eight agent–model–reasoning setups, finding that while the best configuration (Codex with DeepSeek‑V4.1‑Flash) produces passing tests for 82.8% of cases, only 33.8% are behaviorally adequate, as measured by kill‑completeness. The study highlights diminishing returns from scaling agents, the impact of under‑specified requirements, and the potential of requirement‑grounded harnesses to improve test generation.

By Binhang Qi, Yiming Liu, Yun Lin, Yangjie Zhou, Hailong Sun, Jin Song Dong
arXiv AI
Sep 24

Schr\"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?

Schr"odinger's Repository (Schr"odingerRepo) is an evaluation framework that tests coding agents on dynamically instantiated repository representations to mitigate data leakage from static repository benchmarks. It transforms test repositories through four levels—problem statement reconstruction, namespace remapping, intra-file layout reordering, and functionality-preserving code rewriting—to obscure familiar cues while preserving executable behavior. Experiments on popular LLMs using SWE-bench Verified and SWE-QA show that removing these cues consistently degrades performance and increases interaction costs, mainly due to harder repository exploration and localization.

By Silin Chen, Yufei Yang, Xiaodong Gu, Yuling Shi, Chengcheng Wan, Haibing Guan
arXiv AI
Oct 9

TestJack: Should you trust the results in coding benchmarks? Agentic Coding Benchmarks Auditing via Evaluator Evolution

TestJack is a scalable framework that audits large language model (LLM) coding agents by generating new tests for each trial, focusing on prompt requirements that may be violated. It keeps only the tests passed by the ground‑truth patch and re‑examines failures, providing replayable evidence for each confirmed error. In experiments across six model backends and five benchmarks, TestJack found that 34.4% of trials deemed correct actually violated task requirements, reducing the overall resolution rate from 50.6% to 33.2%.

By Shuangjie Yao, Hao Wang, Koushik Sen, Simin Chen, Baishakhi Ray, Dawn Song
arXiv AI
Aug 26

Robust Code RL via Faulty-Code-Driven Test case Synthesis and Dense Reward Shaping

The paper introduces RobustTests, a framework that improves reinforcement learning for code generation by synthesizing test cases from faulty code and refining rewards with a dense, stepwise function. It uses validator agents and behavioral clustering to filter out invalid or redundant tests, and incorporates pass‑rate‑based rewards to counter hallucination noise. Experiments on CodeContests and LiveCodeBench show that fine‑tuning Qwen3‑32B with RobustTests yields a 3% absolute performance gain over baseline methods.

By Yiwen Zhang, Xiaodong Yan, Zhenyu Huang, Deng Zhao, Liang Jiang, Qing Cui, Zujie Wen, Zhiqiang Zhang, Jun Zhou
arXiv AI
Jul 24

PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generation

arXiv:2605. 25572v2 Announce Type: replace-cross Abstract: The growing complexity of quantum programming frameworks has exposed a critical limitation in existing large language model (LLM)-based code assistants: general-purpose models hallucinate PennyLane-specific gate names, misplace device configurations, and produce structurally invalid circuits when faced with specialized quantum coding challenges.

By Minghao Shao, Nouhaila Innan, Hariharan Janardhanan, Muhammad Kashif, Alberto Marchisio, Muhammad Shafique
arXiv AI
Oct 9

Characterizing Overconfident Failure in LLM-Based Code Generation

The paper investigates how large language models (LLMs) used for code generation can produce syntactically plausible but incorrect programs, a phenomenon termed overconfident failure. By evaluating four open-source code models across three execution-based benchmarks, the authors examine whether token-level uncertainty metrics can predict execution correctness, analyze overconfidence at both global and local levels, and test mitigation strategies such as selective generation and instruction tuning. Their findings show that existing uncertainty signals are only partially reliable, overconfidence persists across models, instruction tuning can increase certainty without improving correctness discrimination, and common mitigation techniques do not fully resolve the issue. "whyItMatters":"The study highlights that current uncertainty metrics and mitigation strategies are insufficient to reliably detect or prevent incorrect code generation, underscoring the need for better reliability signals in LLM-based code synthesis."

By Ravishka Rathnasuriya, Wei Yang