Using hypothesis in testing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using hypothesis in testing

mattip
Administrator

We have discussed using the hypothesis package to generate test cases at a few meetings informally. At the EuroSciPy sprint, kitchoi took up the challenge and issued a pull request https://github.com/numpy/numpy/pull/14440 that actually goes ahead and does it. While not finding any new failures, the round-trip testing of s = np.array2string(np.array(s)) shows what hypothesis can do. The new test runs for about 1/2 a second. In my mind the next step would be to use this style of testing to expose problems in the np.chararray routines.


What do you think? Is the cost of adding a new dependency worth the more thorough testing?

Matti


_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Using hypothesis in testing

Tyler Reddy
I think the pros outweigh the cons -- I'll comment briefly on the PR.

On Mon, 9 Sep 2019 at 02:41, Matti Picus <[hidden email]> wrote:

We have discussed using the hypothesis package to generate test cases at a few meetings informally. At the EuroSciPy sprint, kitchoi took up the challenge and issued a pull request https://github.com/numpy/numpy/pull/14440 that actually goes ahead and does it. While not finding any new failures, the round-trip testing of s = np.array2string(np.array(s)) shows what hypothesis can do. The new test runs for about 1/2 a second. In my mind the next step would be to use this style of testing to expose problems in the np.chararray routines.


What do you think? Is the cost of adding a new dependency worth the more thorough testing?

Matti

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion