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

Observe test case distribution #127

Closed
bitemyapp opened this issue Nov 4, 2017 · 7 comments
Closed

Observe test case distribution #127

bitemyapp opened this issue Nov 4, 2017 · 7 comments

Comments

@bitemyapp
Copy link

https://hackage.haskell.org/package/QuickCheck-2.10.1/docs/Test-QuickCheck-Property.html#v:classify

Example: http://hackage.haskell.org/package/checkers-0.4.9.5/docs/src/Test-QuickCheck-Utils.html#isCommutable

isTotalOrder :: (Arbitrary a,Show a,Ord a) => a -> a -> Property
isTotalOrder x y =
    classify (x > y)  "less than" $
    classify (x == y) "equals" $
    classify (x < y)  "greater than" $
    x < y || x == y || x > y
@bitemyapp bitemyapp changed the title Missing classify from Test.QuickCheck.Property Missing classify, cover from Test.QuickCheck.Property Nov 4, 2017
@thumphries thumphries changed the title Missing classify, cover from Test.QuickCheck.Property Observe test case distribution Dec 6, 2017
@mbrock
Copy link

mbrock commented Mar 25, 2018

It seems hard to feel confident in property tests without something like this, no? Especially when input domains are large and there's some class of rare cases that you still want to make sure are represented.

@thumphries
Copy link
Member

thumphries commented Mar 25, 2018 via email

@mankyKitty
Copy link
Contributor

mankyKitty commented Jun 28, 2018

I have a basic implementation of such a thing: https://github.com/qfpl/tasty-hedgehog-coverage

Happy to try to make this into a more useful "built-in" part of Hedgehog, if there's interest.

EDIT: This is now on hackage https://hackage.haskell.org/package/tasty-hedgehog-coverage

@ruhatch
Copy link
Contributor

ruhatch commented Feb 27, 2019

@thumphries is the approach taken in tasty-hedgehog-coverage good enough to make it into hedgehog proper? I'd be happy to submit a PR to try and combine them

@mankyKitty
Copy link
Contributor

@ruhatch Happy to help if required, feel free to throw issues/PRs at tasty-hedgehog-coverage too.

@moodmosaic
Copy link
Member

Resolved via #253, #262, #288, and #289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants