paper-with-me

Papers

Use Property-Based Testing to Bridge LLM Code Generation and Validation

2025-06-23 · Lehan He, Zeren Chen, Zhe Zhang, Jing Shao, Xiang Gao, Lu Sheng

Large Language Models (LLMs) excel at code generation, but ensuring their outputs to be functionally correct, especially in complex programming tasks, is a persistent challenge. While traditional Test-Driven Development (TDD) offers a path for code refinement, its efficacy with LLMs is often undermined by the scarcity of high-quality test cases or the pitfalls of automated test generation, including biased tests or inaccurate output predictions that can misdirect the correction process. This paper introduces Property-Generated Solver, a novel framework that leverages Property-Based Testing (PBT) to validate high-level program properties or invariants, instead of relying on specific input-output examples. These properties are often simpler to define and verify than directly predicting exhaustive test oracles, breaking the "cycle of self-deception" where tests might share flaws with the code they are meant to validate. Property-Generated Solver employs two collaborative LLM-based agents: a Generator dedicated to code generation and iterative refinement, and a Tester that manages the PBT life-cycle and formulate semantically rich feedback from property violations. The resulting comprehensive and actionable feedback then guides the Generator in its refinement efforts. By establishing PBT as the core validation engine within this iterative, closed-loop paradigm, Property-Generated Solver provides a robust mechanism for steering LLMs towards more correct and generalizable code. Extensive experimental results on multiple code generation benchmarks demonstrate that Property-Generated Solver achieves substantial pass@1 improvements, ranging from 23.1% to 37.3% relative gains over established TDD methods.

📄 PDF Abstract BibTeX arXiv:2506.18315

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generationtest driven development

Similar Papers 제목 키워드 기반

HarnessLLM: Automatic Testing Harness Generation via Reinforcement Learning

2025-11-02 · Yujian Liu, Jiabao Ji, Yang Zhang, Wenbo Guo 외 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 …

Reinforcement LearningCode Generation

testRNN: Coverage-guided Testing on Recurrent Neural Networks

2019-06-20 · Wei Huang, Youcheng Sun, Xiaowei Huang, James Sharp

Recurrent neural networks (RNNs) have been widely applied to various sequential tasks such as text processing, video recognition, and molecular property prediction. We introduce the first coverage-guided testing tool, co…

Molecular Property PredictionProperty PredictionVideo Recognition

Large Language Models for Code: Security Hardening and Adversarial Testing

2023-02-10 · Jingxuan He, Martin Vechev

Large language models (large LMs) are increasingly trained on massive codebases and used to generate code. However, LMs lack awareness of security and are found to frequently produce unsafe code. This work studies the se…

Code GenerationProgram Synthesis

Exploiting Binary Floating-Point Representations for Constraint Propagation: The Complete Unabridged Version

2013-08-18 · Roberto Bagnara, Matthieu Carlier, Roberta Gori, Arnaud Gotlieb

Floating-point computations are quickly finding their way in the design of safety- and mission-critical systems, despite the fact that designing floating-point algorithms is significantly more difficult than designing in…

Prose2Policy (P2P): A Practical LLM Pipeline for Translating Natural-Language Access Policies into Executable Rego

2026-03-16 · Vatsal Gupta, Darshan Sreenivasamurthy arxiv

Prose2Policy (P2P) is a LLM-based practical tool that translates natural-language access control policies (NLACPs) into executable Rego code (the policy language of Open Policy Agent, OPA). It provides a modular, end-to-…