Skip to content

Exercise review comments #6

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

Closed
noelmarkham opened this issue Jul 11, 2016 · 2 comments · Fixed by #9
Closed

Exercise review comments #6

noelmarkham opened this issue Jul 11, 2016 · 2 comments · Fixed by #9

Comments

@noelmarkham
Copy link
Collaborator

As discussed, my comments from these exercises. I think they're really good.

Properties

  • The sqrt function returns Double, not Int, even though (for example) 9.0 == 9. But the property provided does not work for negative numbers. While I understand this is only an example, and thus it doesn't matter if the property holds or not, I would suggest it would be clearer if the property holds, and is unambiguous.
  • I think the explanation of implication could be better.
  • The implication example ((n == 0) ==> (n == 0)) is a bit confusing. I think it would be better if the implication was different to the property.
  • In Combining Properties, have both forAlls at the same indent level, as I thought these were nested.
  • I think the Grouping Properties section is confusing because the ZeroSpecification class takes a parameter, which (I think) is only ever 0. I think it would just be clearer if the value parameter is removed and simply replaced with 0.

Generators

  • Be consistent with { and ( on the check methods.

I can't think of any headline items to add, perhaps you may want to show a property that actually fails, and perhaps how to label properties and generators.

I've not done a language review on this either, please let me know if you want me to do that.

I'll leave these suggestions to you, but I'm happy to help if you need it.

@fedefernandez
Copy link
Contributor

Hi @noelmarkham

Thanks for the feedback. I've created a PR that address a couple of suggestions (forAll indentation and consistency with { and (). See #7

Also, I've created an issue to improve the Grouping Properties section. We need to figure out how to improve the exercise and let the user introduce some value. See #8

Related with the three first bullets and the lang review, practically all texts has been taken from the User Guide but we could improve them.

Please, feel free to create any PRs or leave me more suggestions, any help will be very appreciated.

Thanks

@noelmarkham
Copy link
Collaborator Author

Ok, regarding the first three bullets:

  • I've just looked at this in the documentation, and it is explained that it fails there. I'd suggest:
    • Keep the sqrt as-is (I can live with the double/int discrepancy), but show the failure text (just like the ScalaCheck docs).
    • Include another example before the sqrt example of a property passing (the ScalaCheck docs has list concatenation - that seems fine to me).
  • I've reread the implication explanation, and it's fine.
  • How about (n == 0) ==> n + 10 == 10

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

Successfully merging a pull request may close this issue.

2 participants