property-based testing
Generate inputs to test a general property rather than only handpicked examples.
Use this when A parser or transformation has many combinations and boundary cases.
without the term
“Our date parser works on the examples I wrote, but users keep finding weird inputs that break it. Can you test it with tons of generated inputs to find edge cases?”
with the term · How do you ask a model for property-based testing?
Add property-based tests for this round trip. Generate edge cases and preserve any failing counterexample as a regression test.
What is property-based testing?
Instead of a few hand-picked inputs, the framework generates many and checks a rule that must always hold, such as 'parse(format(x)) equals x'. It then shrinks any failure to a small example.
Why does property-based testing matter when vibe coding?
A few generated examples may miss the exact condition that breaks an invariant.
How do you do property-based testing?
Define a useful invariant, generate representative inputs, and keep discovered regressions.
What goes wrong with property-based testing?
Choosing a property so weak that a broken implementation satisfies it.