Source: Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich ====== Property-based testing ====== PBT is an approach to [[software_testing|testing]] in which we test the properties of a function rather than individual examples. Instead of a single test with specific input data, the framework generates hundreds of random cases. ==== Strengths of PBT ==== - Finds hidden bugs that are not covered by specific tests. - Expresses the behavior of the system through properties. - Automatically generates hundreds of inputs. - Reduces the risk of "bias", when tests check only "convenient" cases. ==== Best practices ==== - Formulate properties at the domain level. - Don't overuse PBT: for complex business logic, you also need regular tests. - Use a fixed seed for reproducibility. - Combine PBT with [[random-based_tests|random-based]] and sample tests.