# PBT-Bench: Benchmarking AI Agents on Property-Based Testing

*Guohao Jing, Xinqi Wang, Liao Zhang, Simon Du*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/138920) · [OpenReview](https://openreview.net/forum?id=wota1ZN4By) · [alphaXiv](https://www.alphaxiv.org/abs/2605.15229) · [Open on the map](../papers.html#p138920)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Software Engineering Benchmarks](../pgroup/646.md) · Type: benchmark or dataset · Keywords: property-based testing, benchmark, AI agents, documentation reasoning, Hypothesis, LLM evaluation

Areas: [Code & Coding Agents](../areas/codegen.md) › Code Verification › Software engineering benchmarks; [AI Agents](../areas/agents.md) › Agent Benchmarking › Software agent benchmarks; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Software Engineering Benchmarks; [Benchmarks for LLMs & Agents](../areas/bench-llm-agents.md) › Cross-Domain Agent Evaluation › Software Engineering Benchmarks

## Summary
PBT-Bench is a benchmark of 100 property-based testing problems across 40 Python libraries that evaluates AI agents' ability to infer semantic invariants from documentation and craft precise input-generation strategies, revealing model-specific strengths and weaknesses.

## Explained to a 5-year-old
We made a big set of puzzles that teach computers how to read instructions and find hidden mistakes. Each puzzle hides a secret rule that you must discover by looking at the instructions. Then you write a special recipe to make the computer try the right examples to find the mistake. We tested many smart computers on these puzzles and saw which ones were good at finding the rules and which ones needed help.

## Explained to a 5-year-old, longer
Imagine you have a bunch of computer programs that need to be safe. To check them, we created 100 different games that look like real programming libraries. In each game, someone hid a tricky bug that is hard to find by just guessing random inputs. The goal is to read the game’s manual, figure out what rule must always stay true, and then write a special plan that makes the computer try the right kinds of inputs to break the rule. We gave this plan to eight different smart computers and asked them to solve the games. Some computers did really well, some needed a little help, and a few got confused because the plan was too strict. The hardest games were different for each computer, so no single computer could solve everything. We shared all the games and plans so other people can keep improving these smart computers.

## For a technical reader
The paper presents a benchmark (PBT-Bench) that isolates property-based testing by providing 100 curated problems with injected semantic bugs across 40 Python libraries. Agents must read documentation, identify invariants, and write Hypothesis @given strategies to focus random search. Evaluation compares eight LLMs under open-ended and structured prompting, measuring bug recall. Results show structured prompts boost mid-tier models but can hinder some top models, and bug difficulty varies by model architecture.

## Problem
Existing code benchmarks do not isolate the skill of property-based testing, which requires agents to infer semantic invariants from documentation and create precise input-generation strategies to expose bugs via random search.

## Method
The approach creates a curated collection of testing problems with injected semantic bugs at three difficulty levels, requiring agents to read documentation, identify invariants, and write Hypothesis @given strategies that focus random search on bug-triggering inputs. It then evaluates eight LLMs under two prompting regimes-open-ended and structured scaffolding-over multiple runs, measuring bug recall.

## Results
Bug recall under the structured prompt ranged from 42.1% to 83.4%, while the open-ended baseline ranged from 31.4% to 76.7%; hypothesis scaffolding improved mid-capability models by over 20 percentage points but degraded two strong models. The hardest bugs were model-specific, leaving gaps no single model closed.

## Contributions
The work introduces a curated benchmark of property-based testing problems with stratified difficulty and semantic bugs, a harness for evaluating agents on invariant derivation and strategy specification, and an empirical comparison of eight LLMs under two prompting regimes, revealing model strengths and limitations.

## Limitations and assumptions
Limited to Python libraries and eight LLMs; structured prompting can degrade performance on some models; bug difficulty is model-specific.

## Practical relevance
Providing an open benchmark and tools enables researchers to improve AI agents' documentation-grounded reasoning and systematic test generation for reliable software.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/138920)
