mlsanityData to 7 Oct 2026

Can Large Language Models Write Good Property-Based Tests?

arXiv 2307.04346 ↗First posted 10 Jul 2023cs.SEcited by 30

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

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 9; 2024: 8; 2025: 7; 2026: 6.

30 papers.

Sort:

By area:

  1. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
  2. 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
  3. 2023Fuzz4All: Universal Fuzzing with Large Language Modelscited by 88
  4. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  5. 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
  6. 2023Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generationcited by 49
  7. 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?cited by 32
  8. 2023Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 21
  9. 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Codecited by 9
  10. 2026Text-to-CAD Evaluation with CADTestscited by 9
  11. 2025Agentic Property-Based Testing: Finding Bugs Across the Python Ecosystemcited by 7
  12. 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6
18 more
  1. 2024Using Large Language Models for Student-Code Guided Test Case Generation in Computer Science Educationcited by 4
  2. 2025Code Copycat Conundrum: Demystifying Repetition in LLM-based Code Generationcited by 4
  3. 2025PBFuzz: Agentic Directed Fuzzing for PoV Generationcited by 4
  4. 2024Toward Automated Validation of Language Model Synthesized Test Cases using Semantic Entropycited by 3
  5. 2025Program Skeletons for Automated Program Translationcited by 3
  6. 2024S3LLM: Large-Scale Scientific Software Understanding with LLMs using Source, Metadata, and Documentcited by 2
  7. 2024LLMs in the Heart of Differential Testing: A Case Study on a Medical Rule Enginecited by 2
  8. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  9. 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 2
  10. 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
  11. 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
  12. 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capabilitycited by 1
  13. 2026VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generationcited by 1
  14. 2026Teaching Code LLMs to Reason with Intermediate Formal Specificationscited by 1
  15. 2023CodeScholar: Growing Idiomatic Code Examplescited by 0
  16. 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generationcited by 0
  17. 2026Fuzzing with Agents? Generators Are All You Needcited by 0
  18. 2026PBT-Bench: Benchmarking AI Agents on Property-Based Testingcited by 0