-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deletion challenge #5
Comments
I'd be happy to change the challenge in that way. @DRMacIver What do you think? |
I don't mind the change, certainly, but I think it might need a bit of clarification. Specifying "list of integers" is uncontroversial and I agree it's a good change, but I don't think it's clear enough from the proposed change that the removed integer should be generated fully independently from the list, which I think is the intent? Maybe adding something like "The element to be deleted should be generated without reference to the generated list." as well? |
Yes, that's the intent. I am fine with whatever phrasing makes this intent as clear as it can get. |
I'm not quite sure of that one. Do you think that given two random and independent generators,
If I - as the property writer - had an inkling that the individual integer is somehow connected to the list I'd definitely tune the generator in that direction or at least check statistically that it occurs regularly in the list. If I do not have that inkling why should a generator prioritize duplication of that exact constellation? |
The deletion challenge as well as its original source are sub-optimal (as PBT challenges) in my opinion -- at least the way they are currently implemented.
Given a list delete implementation that removes only the first occurrence of the element that is to be removed, instead of testing for the property:
the challenge for PBT tools should be testing the following more general property instead:
The difference in what a PBT tool needs to do, both in generation and shrinking, is significant.
For starters, it's quite challenging to generate both a random integer x and a list of integers that contains x at least twice in order to falsify this property. So, this tests the effectiveness of the generation component.
When a counterexample is found, the two (independent) generators have to be shrunk in concert.
I propose to update the challenge to this one.
The text was updated successfully, but these errors were encountered: