Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

[WIP] Add hypothesis to some str methods #511

Closed
wants to merge 2 commits into from

Conversation

eliasdorneles
Copy link
Collaborator

This is a WIP and not ready to merge, but I've been playing with hypothesis lately with help from @damedebugger (hi!).

I don't know if Str.java is the best place to start, but I keep finding new bugs for the existing methods so it'll take a little while for this to be ready.
It might make sense to split this into separate PRs, but as I also want to find a good way of reusing the strategies for other functions I'll continue working on this branch for now.

I hope this will be handy for ensuring quality of the patches, I know I'll be glad to not have to think so hard to cover the edge cases. :)

@eliasdorneles
Copy link
Collaborator Author

After thinking more about this, trying out things with @mistermocha and talking briefly with @freakboy3742, I now believe it will make more sense to limit the hypothesis usage for development and not on the regular Travis builds, for two reasons:

  • it would increase the build time greatly
  • it would find many problems that we have no clear solution yet, like the discrepancy between different versions of Unicode data

For reference, here are the Unicode data versions of CPython:

$ $(pythonz locate 3.4.4) -c 'import unicodedata; print(unicodedata.unidata_version)'
6.3.0
$ $(pythonz locate 3.5.3) -c 'import unicodedata; print(unicodedata.unidata_version)'
8.0.0
$ $(pythonz locate 3.6.1) -c 'import unicodedata; print(unicodedata.unidata_version)'
9.0.0

In the JVM land, Java 7 uses 6.0.0, Java 8 uses 6.2.0, Java 9 will be 7.2.0.

These causes differences some subtle differences of behavior for methods like isupper/islower and I believe isdigit as well.

@Zac-HD
Copy link

Zac-HD commented Aug 10, 2017

While the issues noted above are real, I'd also like to note that you can choose how many examples Hypothesis will try - 2000 might be unacceptably slow, but what about 50? You can also use it for some types but not others - Unicode is always tricky, but numeric and simple collection types could benefit enormously.

As noted on #580, I'd be happy personally and as a maintainer of Hypothesis to assist anyone who wants to take this on.

@phildini
Copy link
Member

Hi there! It looks like this PR might be dead, so we're closing it for now. Feel free to re-open it if you'd like to continue, or think about directing your efforts to https://github.com/beeware/briefcase or https://github.com/beeware/toga. Both of these have more active development right now. 😄

@phildini phildini closed this Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants