mlsanityData to 24 Nov 2026

Spec-Driven PBT: Deriving Semantic Invariants from Code Specifications for Agentic Property-based Testing

arXiv 2611.15920 ↗Submitted 11 Nov 2026cs.SE cs.AIcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Software is increasingly written by AI agents that produce an implementation from a natural language specification, a practice known as agentic coding. Code is now produced faster than it can be reviewed, and has been shown to exhibit its own characteristic failure patterns. Property-based testing (PBT), a long-standing technique in which invariant properties of a program are checked against many generated inputs, has recently been revisited with LLM agents authoring the properties, thereby removing the high-effort derivation of invariants that has long hindered its adoption. Existing methods, however, derive these properties from the implementation alone (Code-driven PBT). At the same time, a thorough specification such as a product requirements document has become routine within agentic coding, yet its role in testing the resulting code remains underexplored. We study the value of the specification as a source of properties for testing agent-written code. Our key insight is that the specification, unlike the implementation, records what the code was meant to do, and invariants derived from it are not biased by particular implementation choices. We propose Spec-Driven PBT, an agent that first expresses invariants in natural language from the specification and only then inspects the implementation to translate them into concrete tests. Across 25 applications from ViBench, Spec-Driven PBT finds a novel set of bugs that Code-driven PBT misses, while writing 2.4x fewer property tests. Though the two approaches surface a roughly equivalent number of bugs, there is little overlap: nearly 60% of the 169 total bugs are found by only one. Qualitatively, we find that the bugs unique to Spec-Driven PBT tend to violate documented product workflows whereas those to Code-driven PBT instead concentrate on implementation robustness, offering complementary value for bug discovery in agent-written code.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 20 of its 36 references that are in the map. Submitted 11 Nov 2026.

Builds on

20 of 36 references.

Closest ancestors · 5

Same direction, newest first

  1. 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation17 Aug
  2. 2026The End of Code Review: Coding Agents Supersede Human Inspection11 Jun
  3. 2026PBT-Bench: Benchmarking AI Agents on Property-Based Testing13 May
  4. 2026ProjDevBench: Benchmarking AI Coding Agents on End-to-End Project Development2 Feb
  5. 2025Agentic Property-Based Testing: Finding Bugs Across the Python Ecosystem10 Oct

Other references · 15

  1. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
  2. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 200
  3. 2022Large Language Models are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Modelscited by 107
  4. 2025Are "Solved Issues" in SWE-bench Really Solved Correctly? An Empirical Studycited by 69
  5. 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 64
  6. 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 57
  7. 2025BaxBench: Can LLMs Generate Correct and Secure Backends?cited by 48
  8. 2023Can Large Language Models Write Good Property-Based Tests?cited by 37
  9. 2024Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Modelscited by 31
  10. 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Taskscited by 30
  11. 2026Vibe Code Bench: Evaluating AI Models on End-to-End Web Application Developmentcited by 12
  12. 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 3
3 more
  1. 2026Understanding the (In)Security of Vibe-Coded Applicationscited by 3
  2. 2026From Natural Language to Executable Properties for Property-based Testing of Mobile Appscited by 2
  3. 2026Specification Grounding Drives Test Effectiveness for LLM Codecited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization
  2. 2026FVSpec: Real-World Property-Based Tests as Lean Challenges
  3. 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents
  4. 2026Skeleton Coding: Program Structure as a Specification for Agents
  5. 2026Agentic Proof and Property-Based Testing via Property-Templates in Data-Intensive Computing
  6. 2026SDAD: Spec-Driven Agentic Development for the AI-Native SDLC
  7. 2026Benchmarking LLM Agents for Behaviorally Adequate Test Generation from Software Requirements
  8. 2026LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle