Skip to content
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

Arbitrary[Algebraic] only generates ConstantLong Exprs #757

Open
LukaJCB opened this issue Jan 9, 2019 · 3 comments
Open

Arbitrary[Algebraic] only generates ConstantLong Exprs #757

LukaJCB opened this issue Jan 9, 2019 · 3 comments

Comments

@LukaJCB
Copy link
Member

LukaJCB commented Jan 9, 2019

This is the Gen used for Algebraic right now:

lazy val algebraic: Gen[Algebraic] =
  arbitrary[Int].map(Algebraic(_))

I'd argue to really test Algebraic we need a more throrough Gen.

@tixxit
Copy link
Contributor

tixxit commented Jan 9, 2019

Definitely agree. One annoyance is that the Algebraic tests can be pretty slow and making them more complicated will only make things worse. We'll probably want to disproportionately weight the random Algebraics towards simpler ones, but still allow some complex ones through.

@LukaJCB
Copy link
Member Author

LukaJCB commented Jan 9, 2019

We could potentially restrict the number of values generated for CI only, WDYT?

@denisrosset
Copy link
Collaborator

How do we do that, actually?

PS: I dream of a scalacheck-type framework, where the complexity of generated instances could be described by a tuple of integers (i,j,k,...); properties would then declare a time t(i,j,k,...) and space s(i,j,k,...) complexity. Then, when running the tests, we could assign a time budget for all the runs (which the sum of all time complexities must not overrun), and a memory budget (which each run can't cross).

JoeWrightss pushed a commit to JoeWrightss/spire that referenced this issue Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants