Can Large Language Models Write Good Property-Based Tests?
Not on the map. Why?
Abstract (arXiv)
Property-based testing (PBT), while an established technique in the software testing research community, is still relatively underused in real-world software. Pain points in writing property-based tests include implementing diverse random input generators and thinking of meaningful properties to test. Developers, however, are more amenable to writing documentation; plenty of library API documentation is available and can be used as natural language specifications for PBTs. As large language models (LLMs) have recently shown promise in a variety of coding tasks, we investigate using modern LLMs to automatically synthesize PBTs using two prompting techniques. A key challenge is to rigorously evaluate the LLM-synthesized PBTs. We propose a methodology to do so considering several properties of the generated tests: (1) validity, (2) soundness, and (3) property coverage, a novel metric that measures the ability of the PBT to detect property violations through generation of property mutants. In our evaluation on 40 Python library API methods across three models (GPT-4, Gemini-1.5-Pro, Claude-3-Opus), we find that with the best model and prompting approach, a valid and sound PBT can be synthesized in 2.4 samples on average. We additionally find that our metric for determining soundness of a PBT is aligned with human judgment of property assertions, achieving a precision of 100% and recall of 97%. Finally, we evaluate the property coverage of LLMs across all API methods and find that the best model (GPT-4) is able to automatically synthesize correct PBTs for 21% of properties extractable from API documentation.
Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). First posted on arXiv 10 Jul 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 9; 2024: 8; 2025: 7; 2026: 6.
30 papers.
Sort:
By area:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2023Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generationcited by 49
- 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?cited by 32
- 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 21
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Codecited by 9
- 2026Text-to-CAD Evaluation with CADTestscited by 9
- 2025Agentic Property-Based Testing: Finding Bugs Across the Python Ecosystemcited by 7
- 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6
18 more
- 2024Using Large Language Models for Student-Code Guided Test Case Generation in Computer Science Educationcited by 4
- 2025Code Copycat Conundrum: Demystifying Repetition in LLM-based Code Generationcited by 4
- 2025PBFuzz: Agentic Directed Fuzzing for PoV Generationcited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
- 2025Program Skeletons for Automated Program Translationcited by 3
- 2024S3LLM: Large-Scale Scientific Software Understanding with LLMs using Source, Metadata, and Documentcited by 2
- 2024LLMs in the Heart of Differential Testing: A Case Study on a Medical Rule Enginecited by 2
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 2
- 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capabilitycited by 1
- 2026VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generationcited by 1
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specificationscited by 1
- 2023CodeScholar: Growing Idiomatic Code Examplescited by 0
- 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 0
- 2026Fuzzing with Agents? Generators Are All You Needcited by 0
- 2026PBT-Bench: Benchmarking AI Agents on Property-Based Testingcited by 0
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specifications5 Jul 2026
- 2026PBT-Bench: Benchmarking AI Agents on Property-Based Testing13 May 2026
- 2026VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generation8 May 2026
- 2026Text-to-CAD Evaluation with CADTests8 May 2026
- 2026Fuzzing with Agents? Generators Are All You Need1 Apr 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025PBFuzz: Agentic Directed Fuzzing for PoV Generation4 Dec 2025
- 2025Agentic Property-Based Testing: Finding Bugs Across the Python Ecosystem10 Oct 2025
- 2025Large Language Models for Software Testing: A Research Roadmap29 Sep 2025
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback23 Jun 2025
- 2025Code Copycat Conundrum: Demystifying Repetition in LLM-based Code Generation17 Apr 2025
- 2025Program Skeletons for Automated Program Translation10 Apr 2025
18 more
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation18 Dec 2024
- 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?3 Dec 2024
- 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?3 Dec 2024
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropy13 Nov 2024
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsification14 Apr 2024
- 2024S3LLM: Large-Scale Scientific Software Understanding with LLMs using Source, Metadata, and Document15 Mar 2024
- 2024LLMs in the Heart of Differential Testing: A Case Study on a Medical Rule Engine16 Feb 2024
- 2024Using Large Language Models for Student-Code Guided Test Case Generation in Computer Science Education11 Feb 2024
- 2023CodeScholar: Growing Idiomatic Code Examples23 Dec 2023
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Code22 Dec 2023
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
- 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation3 Oct 2023
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?3 Oct 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023Fuzz4All: Universal Fuzzing with Large Language Models9 Aug 2023
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generation3 Aug 2023
- 2023Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generation2 Aug 2023
- 2026PBT-Bench: Benchmarking AI Agents on Property-Based Testing13 May 2026
- 2026Fuzzing with Agents? Generators Are All You Need1 Apr 2026
- 2025PBFuzz: Agentic Directed Fuzzing for PoV Generation4 Dec 2025
- 2025Agentic Property-Based Testing: Finding Bugs Across the Python Ecosystem10 Oct 2025
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2023Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generationcited by 49
- 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?cited by 32
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Codecited by 9
- 2026Text-to-CAD Evaluation with CADTestscited by 9
- 2024Using Large Language Models for Student-Code Guided Test Case Generation in Computer Science Educationcited by 4
- 2025Code Copycat Conundrum: Demystifying Repetition in LLM-based Code Generationcited by 4
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
12 most cited of 22 All 22 (JSON)
- 2026VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generation8 May 2026
- 2026Text-to-CAD Evaluation with CADTests8 May 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025Large Language Models for Software Testing: A Research Roadmap29 Sep 2025
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback23 Jun 2025
- 2025Code Copycat Conundrum: Demystifying Repetition in LLM-based Code Generation17 Apr 2025
- 2025Program Skeletons for Automated Program Translation10 Apr 2025
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?3 Dec 2024
- 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropy13 Nov 2024
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsification14 Apr 2024
- 2024S3LLM: Large-Scale Scientific Software Understanding with LLMs using Source, Metadata, and Document15 Mar 2024
12 newest of 22 All 22 (JSON)