arXiv:2610.34487cs.SEOct 2026

Manuscript Offprint

arXiv:2610.34487

A Multi-Domain Study on the Effectiveness of LLMs at Writing Property-Based Tests

M M Abid Naziri, Feiran, Qin, Khush Patel, Marcelo d'Amorim

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

M M ABID NAZIRI*, NC State University, USA

FEIRAN (ALEX) QIN*, NC State University, USA

KHUSH PATEL, NC State University, USA

MARCELO D'AMORIM, NC State University, USA

A property-based test (PBT) checks a property of a program on many generated inputs, but writing one takes a property, a generator of valid inputs, and an oracle. LLM-based PBT writers produce all three, yet they have been evaluated only on Python libraries. We study how two of them, PROTEST-AI and AGENTIC-PBT, generalize to ten programs in five domains: deep learning libraries, databases, system software, compilers, and LLM serving engines. Most of these programs take text in their own language, such as queries, configurations, and programs. AGENTIC-PBT covers more branches than PROTEST-AI on seven of the ten programs with Opus 5 and on all ten with GLM-5.3-Flash. Domain-specific fuzzers cover more of the compilers and of PostgreSQL and less of PyTorch than AGENTIC-PBT. We filed 180 bug reports, 44 of which duplicate reports that others filed after the models' knowledge cutoffs; maintainers have confirmed 65 of the others, in all five domains, and fixed 23. We draw lessons for building and evaluating such writers: low observability hurts them, and mature fuzzers paired with LLM-written properties could check that each feature behaves as documented.

1 Introduction

A property is a predicate over software behavior that must hold for every input in a declared input space [10, 18, 30]. A property-based test (PBT) [10] checks a property on many generated inputs: a generator draws inputs from the input space, and an oracle checks the property on each input and the program's output. PBT libraries such as QuickCheck [10] and Hypothesis [49] run the test and automatically reduce a failing input into a small counterexample. They do not write the test itself. Writing a PBT takes a property worth checking, a generator that respects the constraints the program places on its inputs, and an oracle that knows what the program must compute.

Properties can be mined from a project’s artifacts [5], such as its tests, documentation, and commit history. Techniques for mining properties go back more than two decades [2, 20, 23, 24, 37, 46, 47, 53, 70, 84, 92], and many tools turn mined properties into tests that find bugs [6, 7, 25, 27, 31, 59, 77, 78, 88, 89]. For example, Toradocu [27] mines API documentation, MR-Scout [89] existing tests, and DeepREL [16] the signatures of deep learning APIs. Each of these tools is built for one source, the kind of artifact it mines, and one domain, a class of programs such as deep learning libraries. Moving it to a new source or domain means rebuilding its mining logic and generator.

Large Language Models (LLMs) can read any kind of software artifact, which would replace the per-source mining logic, and they can write the generator and the oracle that a new program needs. We call a tool that uses an LLM to write PBTs an LLM-based PBT writer. Two general-purpose ones have been proposed. PROTEST-AI [79] prompts an LLM with the documentation of one Python API method. AGENTIC-PBT [48] prompts a coding agent, an LLM that can run commands and edit files, to read a Python module's code, write PBTs, run them, revise a test whose failure it judges a false alarm rather than a bug, and report the remaining failures as bugs. Both tools were evaluated only on Python libraries, which take Python values as inputs and need no harness, the code that starts or feeds the program under test.

∗^{*}Equal Contribution.

Authors' Contact Information: M M Abid Naziri, NC State University, Raleigh, NC, USA, mnaziri@ncsu.edu; Feiran (Alex) Qin, NC State University, Raleigh, NC, USA, fqin2@ncsu.edu; Khush Patel, NC State University, Raleigh, NC, USA, kpatel53@ncsu.edu; Marcelo d'Amorim, NC State University, Raleigh, NC, USA, mdamori@ncsu.edu.

Naziri et al.

Their evaluations therefore leave open whether an LLM can write PBTs for programs whose inputs are text in the program’s own language, such as queries, configuration files, or programs. Such an input is valid only under the program’s semantics, and a test usually reaches the program through a process or a server. For such programs, a developer must write a generator that builds valid inputs, and an oracle that either predicts the result or checks it against a second computation. A PBT writer that generalizes would bring property-based testing to database servers, compilers, and system software. Compilers and databases already have mature testing tools [36, 41, 55, 67–69, 73, 93, 98], and such a writer would complement them with one tool that needs only a small harness per domain. We therefore ask: how well does an LLM-based PBT writer generalize across domains, and where does it fall short? To our knowledge, no study has evaluated such a writer on these programs or compared its tests across domains.

Our Work. We answer this question with a study of five domains: deep learning libraries, databases, system software, compilers, and LLM serving engines. We chose widely used domains that differ in how a test reaches the program and in the inputs it must build (Section 3). We study two programs per domain, ten programs in total: JAX [8] and PyTorch [58] (deep learning libraries), PostgreSQL [63] and ArangoDB [4] (databases), OpenSSH [54] and cronie [12] (system software), GCC [26] and Clang [45] (compilers), and vLLM [33] and SGLang [97] (LLM serving engines). Databases, system software, and compilers are reached only through a process or a server, which no prior evaluation covered. For these domains, we give the tools a harness that only runs the program and returns its output, e.g., a module that starts a database server and returns the rows of a query. We write one harness per domain, in about 30 minutes with an LLM's help, and the tests of its two programs share it. The harness does not check the output. The LLM writes all generators, properties, and oracles. Deep learning libraries serve as a control: a test calls them directly with Python values and needs no harness, as in the prior evaluations. LLM serving needs no harness either: tests call the engines' Python APIs. Besides the harness, we change only the 32 of AGENTIC-PBT's 290 prompt lines that locate and read the target, and none of PROPTEST-AI's prompts. Each test targets a focal point, one feature of a program, such as an SQL function or a compiler builtin.

The study has four research questions. RQ1 assesses performance and selects the writer that RQ2 to RQ4 study. We compare the two LLM-based PBT writers with each other on all ten programs, with two LLMs from different vendors, Claude Opus 5 and GLM-5.3-Flash. We measure branch coverage and examine failure reports. RQ2 studies the selected writer, AGENTIC-PBT, per domain: the oracles of its tests and the sources of their properties. RQ3 counts the confirmed bugs that the tests reveal, those that maintainers accept as real. Because an LLM may have seen a bug report during training, a previously reported bug counts only if its first public report postdates the knowledge cutoff of the model that found it. RQ4 compares AGENTIC-PBT with domain-specific tools in three domains, in branch coverage and in the crashes that each reveals: Centaur [52] and FlashFuzz [65] on PyTorch, MetaMut [55] and GrayC [21] on GCC and Clang, and SQLancer [68] on PostgreSQL.

Results. AGENTIC-PBT covers more branches than PROPTEST-AI on seven of the ten programs with Opus 5 and on all ten with GLM-5.3-Flash. Over 12 hours, the domain-specific tools cover more of the compilers and of PostgreSQL, where AGENTIC-PBT reaches 73% to 85% of the leading tool's coverage, and AGENTIC-PBT covers 1.1 to 1.4 times as much of PyTorch as FlashFuzz and Centaur. On the compilers, MetaMut and GrayC find 23 and 4 crashes and AGENTIC-PBT 4, none in common. The documentation states the property of 78% of the tests, and 41% of their oracles compare the output with another run or another implementation rather than check a stated condition. We filed 180 bug reports from AGENTIC-PBT's tests. Among them are 44 duplicates: bugs that others reported independently after the knowledge cutoff of the model that found them. Of the other 136 reports, maintainers have confirmed 65, in every domain and all ten programs, fixed 23, and rejected 3; the rest await a response. Most duplicates are in LLM serving, 36 of the 44.

Key Lessons. We highlight two of the lessons of Section 5.1. First, low observability hurts PBT writers. A property can be documented and still be hard to check when the program does not show the behavior that the property concerns, which affects system-level tests most. A cronie test, for example, has to exceed one of cronie's limits to reveal how cronie reads a crontab line. Second, mature fuzzers and LLM-based writers contribute different parts of a test. The fuzzers reach more of the compilers and of PostgreSQL, but they check crashes or, in SQLancer's case, one relation between queries. The writers take most of their properties from the documentation, and most of the bugs AGENTIC-PBT found are wrong results that only such a property detects. Future work could have MetaMut or SQLancer check properties that an LLM extracts from the documentation.

We make three contributions: (1) a study of general-purpose LLM-based PBT writers on ten programs in five domains, most of which take text in their own language, which measures the coverage, failures, oracles, and bugs of their tests (Section 4); (2) lessons for building and evaluating such writers (Section 5.1); and (3) 65 new bugs confirmed by maintainers, and an artifact with the harnesses, prompts, scripts, tests, and bug reports of the study, so that others can repeat it with other models and writers (Data Availability).

References (38)