Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free
  • Home
  • Pricing
  • AI Models
  • Image models
  • Voice models
  • Video models
  • Rankings
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Credentials
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • idapt Code
  • Code Execution
  • Computers
  • Computer Use
  • Computer Assist · Soon
  • Containers
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • LLM cost calculator
  • Token counter
  • Context window checker
  • Can I run it
  • Model picker quiz
  • Savings finder
  • Video cost estimator
  • Text to speech cost
  • Transcription cost
  • API endpoint tester
  • All free tools →
  • Blog
  • Use cases
  • Comparisons
  • Best of
  • Skills
  • Learn
  • Changelog
  • Help center
  • FAQ
  • Privacy
  • Compare all models
  • Support
  • idapt Code
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)
All skills
Code

Write property-based tests

Generate the inputs nobody thinks of, and shrink the failure to something readable.

Fill it in

The module or function.

The invariants, in your words.

Report the smallest input that breaks it.

Your prompt

Write property-based tests for [your what to test].

Invariants: [your what must always hold]
Find the properties that must hold for ALL inputs, not examples. Round-trip
(parse then format returns the original), invariants (the total never goes
negative), and comparisons against a slow obvious implementation are the three
that find real bugs.

Generate the inputs nobody writes by hand: empty, one element, duplicates,
unicode, the boundary, one past it, and the value that is technically valid and
absurd. That is the entire advantage over example-based tests.

Shrink failures to the smallest reproducing input, and report it as a plain
example test. A 400-character generated string that fails is a bug report nobody
acts on; `add(0.1, 0.2)` is one somebody fixes today.
Run enough cases to mean something, with a fixed seed so a failure reproduces.
Use Write property-based testsOpens with everything above already filled in.

Why this works

A 400-character generated string that fails is a bug report nobody acts on. This shrinks to the smallest reproducing input and reports it as a plain example, and it generates the inputs nobody writes by hand, which is the entire advantage over example tests.

More code skills

  • idapt Code
  • Fix a failing test

Use it now in a chat in 1 click

Use Write property-based tests
Fix a GitHub issue
  • Find security bugs
  • Ship a feature
  • Speed up slow code