3 ms·
I love jqwik, one of the best implementations of property based testing I've ever used! I've actually used it very successfully in industry. The big value in m
by slaymaker1907 5y ago
I love jqwik, one of the best implementations of property based testing I've ever used!
I've actually used it very successfully in industry. The big value in my opinion is how it separates out thinking about your test data from your test cases. Instead of thinking about edge cases for particular functions, you think about what your data can possibly look like and then state what properties need to hold about it.
One tip for anyone trying out jqwik in an enterprise environment is to have static utility classes for generating Arbitrary<YourBusinessType> and then setup your data sources on a per test basis rather than setting defaults for the types globally. I find this makes it easier to manage cases where you have different constraints for common data types that needs to vary per suite of tests. For example, maybe in one case the dates need to be in the past while another suite of tests should be run over any possible date.
- johanneslink 5y ago> One tip for anyone trying out jqwik in an enterprise environment is to have > static utility classes for generating Arbitrary<YourBusinessType> and then > setup your data sources on a per test basis rather than setting defaults for > the types globally I actually prefer to collect the domain-specific generators in a domain context (see https://jqwik.net/docs/current/user-guide.html#domain-and-domain-context https://jqwik.net/docs/current/user-guide.html#domain-and-do...). This requires less ceremony to re-use arbitraries in different container classes.