How does "property-based testing" differ from traditional example-based unit testing?
Correct! Well done.
Incorrect.
The correct answer is A) Instead of asserting specific input/output examples, property-based testing defines general properties that should hold for a wide range of automatically generated inputs, often uncovering edge cases developers wouldn't think to test manually
Correct Answer
Instead of asserting specific input/output examples, property-based testing defines general properties that should hold for a wide range of automatically generated inputs, often uncovering edge cases developers wouldn't think to test manually
Tools like QuickCheck or Hypothesis generate many random inputs and check that defined invariants (properties) hold, often finding edge cases (e.g. empty lists, extreme values) missed by hand-written examples.