Skip to content

informatica-unica/pbt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3e6ac8c · Dec 15, 2024

History

37 Commits
Dec 8, 2024
Dec 15, 2024
Dec 15, 2024

Repository files navigation

Property-based testing

Property-based testing is a testing approach that focuses on verifying general properties of code, rather than specific examples.

Instead of writing individual test cases with predefined inputs and expected outputs (as in unit testing), a property-based test randomly generates input data adhering to given constraints, and checks that your code respects the required properties in all the executions driven by the randomly generated inputs. This approach helps uncover hidden bugs by exposing unexpected behaviors that unit tests might miss.

We show in this repository some examples of property-based testing in Hypothesis (Python) and QCheck (OCaml).

Examples in Python/Hypothesis

Examples in OCaml/qcheck

References

Property-based testing

Hypothesis

Qcheck

Other languages