Property-Based Test Generator

İleritestingEn az 32K bağlam

Generates property-based tests that assert invariants across randomly generated inputs using frameworks like Hypothesis, fast-check, or jqwik. Identifies properties (round-trip, idempotence, invariants, oracle comparison), defines generators and shrinking, and sets up stateful testing for complex APIs. Surfaces edge cases that example-based tests miss.

Kullanım alanları

  • Adding property-based tests for a parser or serializer
  • Testing round-trip and idempotence properties
  • Defining custom generators and shrinking
  • Stateful testing of a data structure or API
  • Finding edge cases example tests miss

Örnek prompt

Generate property-based tests for this function: [paste function].
Include:
1. Identified properties (round-trip, invariants, oracle)
2. Input generators and shrinking strategy
3. Tests using [Hypothesis/fast-check/jqwik]
4. A stateful test if applicable
5. Notes on edge cases the properties should reveal

Önerilen modeller

Uyumlu araçlar

claude-codecursorkiroany

Modaliteler

Giriş: text, code
Çıkış: text, code

İlgili Skills

Yazar

OpenModels Community

@openmodelsrun