test-check

ghadi 2018-03-05T17:44:12.000692Z

@gfredericks what's going on with https://dev.clojure.org/jira/browse/TCHECK-2 ? we just got bit by that

2018-03-05T17:45:18.000448Z

what's a good solution w.r.t. not breaking things? deprecate the old poorly named things and make new things with good names?

ghadi 2018-03-05T17:48:08.000443Z

i guess i'm confused on how it's poorly named vs broken

ghadi 2018-03-05T17:48:47.000834Z

(pos-int? 0) => false

ghadi 2018-03-05T17:50:03.000156Z

IIRC it just so happens that spec filters out by doing (such-that pos-int? gen/pos-int) -- but if you use test.check directly you'll see 0

ghadi 2018-03-05T17:55:42.000105Z

yeah:

user> (clojure.spec.gen.alpha/sample (clojure.spec.alpha/gen pos-int?))

(1 1 1 4 2 4 31 1 8 4)

user> (clojure.test.check.generators/sample clojure.test.check.generators/pos-int)

(0 0 1 1 0 5 1 2 1 4)

2018-03-05T18:16:02.000473Z

I think it was always a case of a bad name; I have no idea where those names came from, but I think the docstrings have reflected the actual behavior

2018-03-05T18:16:21.000489Z

so changing the behavior & docstrings to match the names would potentially break anybody using them

ghadi 2018-03-05T18:16:30.000455Z

ugh

ghadi 2018-03-05T18:16:42.000543Z

what does the s in s-pos-int mean?

2018-03-05T18:17:10.000455Z

"strictly" -- which points even more strongly to the bad names theory

ghadi 2018-03-05T18:17:22.000657Z

lmao

2018-03-05T18:18:15.000090Z

there's a relevant section on integer generators here: https://dev.clojure.org/display/design/Generators+Reboot

ghadi 2018-03-05T18:18:42.000296Z

i see

ghadi 2018-03-05T18:22:13.000561Z

in rich's compatibility algebra of provides and requires -- is not returning 0 a breaking change? Is it possible that certain random seeds never see 0?

2018-03-05T18:22:44.000606Z

I've wondered about how the compatibility algebra applies to generators and distributions 😄

2018-03-05T18:23:17.000151Z

I do think reducing the distribution is a breaking thing

2018-03-05T18:23:25.000763Z

you're silently causing users' generators to test less than they used to

ghadi 2018-03-05T18:23:32.000584Z

my 2c: this generator is busted and it's not that big of a deal to remove 0. (There is an argument around people relying on behavior whether correct or not)

ghadi 2018-03-05T18:24:11.000800Z

i can be persuaded either way -- but not for a crappy name like s-pos-int

2018-03-05T18:25:54.000848Z

no I don't think "leave everything as-is" is a good solution

2018-03-05T18:26:39.000525Z

given zero is such an important edge case a lot of the time, silently making people's tests less effective is also a bad idea I think

2018-03-05T18:27:28.000597Z

I think the bigger question that needs deciding is the one from the link above -- whether to start a new namespace or improve things by deprecating individual generators

2018-03-05T18:27:47.000699Z

I feel like rich's paradigm could use some good deprecation tooling

2018-03-05T19:14:35.000603Z

woah the spec alias of the exact same name has different behavior?

2018-03-05T19:14:45.000260Z

gee willickers

ghadi 2018-03-05T19:18:51.000263Z

yup

ghadi 2018-03-05T19:19:23.000133Z

maybe we should ask Rich on the mailing list

2018-03-05T19:21:50.000537Z

about deprecation or about generator aliasing?

ghadi 2018-03-05T19:23:36.000082Z

The former

2018-03-05T19:29:30.000160Z

like whether deprecation is a good idea at all, or the specific question of how we should do it exactly?

ghadi 2018-03-05T19:34:11.000189Z

what to do specifically

ghadi 2018-03-05T19:34:25.000091Z

need a third set of eyes