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

Adopt Property Based Testing #303

Closed
ebuchman opened this issue Jun 5, 2020 · 8 comments
Closed

Adopt Property Based Testing #303

ebuchman opened this issue Jun 5, 2020 · 8 comments
Assignees
Milestone

Comments

@ebuchman
Copy link
Member

ebuchman commented Jun 5, 2020

We want to produce an example of using property based testing in our code.

This issue will be complete when a single example is completed. This can be as simple as a spike.

Tony mentioned proptest in - #261 (comment) and #248 (comment)

@ebuchman ebuchman added the tests label Jun 5, 2020
@tony-iqlusion
Copy link
Collaborator

tony-iqlusion commented Jun 8, 2020

Some alternatives to consider:

  • quickcheck - original Rust port of QuickCheck
  • crux-mir - symbolic execution of Rust MIR code inside the yices SMT solver, with the ability to write tests in Rust. Requires an awful lot of RAM for anything remotely complicated.

All that said, I use proptest.

@ebuchman
Copy link
Member Author

ebuchman commented Jul 27, 2020

@thanethomson want to look into this at some point? We've had a lot of serialization issues like #451 from insufficient testing ...

I'm going to add this to next milestone which already has a lot of other testing stuff for the light client but we should keep in mind the need to improve testing the serialization boundary as well even if it needs to happen iteratively through follow up issues

@ebuchman ebuchman added enhancement New feature or request verification and removed enhancement New feature or request labels Jul 27, 2020
@ebuchman ebuchman added this to the v0.16.0 milestone Jul 27, 2020
@thanethomson thanethomson self-assigned this Jul 27, 2020
@thanethomson
Copy link
Contributor

@ebuchman sure thing! Added it to the backlog 👍

@thanethomson thanethomson modified the milestones: v0.16.0, v0.17.0 Aug 26, 2020
@ebuchman ebuchman modified the milestones: v0.17.0, v0.18 Aug 28, 2020
@ebuchman
Copy link
Member Author

ebuchman commented Sep 8, 2020

Interesting emerging relevant work from Google: https://alastairreid.github.io/why-not-both/

@konnov
Copy link
Contributor

konnov commented Sep 9, 2020

Nice that Google joins the race. Microsoft Research has been generating unit tests with model checking for ages: https://www.microsoft.com/en-us/research/publication/pex-white-box-test-generation-for-net/

@tarcieri
Copy link
Contributor

The Project Oak approach is quite a bit different from "generating unit tests with model checking".

It provides a common API for property-based testing and symbolic execution systems, which is nice because those systems have a common developer-facing API (test oracle versus assertions) but different tradeoffs (exhaustiveness vs system resource requirements).

@shonfeder
Copy link
Contributor

I talked with @thanethomson and @ebuchman about picking up this issue. Thane and I are going to sync next week, and I've reached out to Romain to get some pointers from him as well.

@shonfeder shonfeder self-assigned this Nov 28, 2020
@thanethomson
Copy link
Contributor

I'd say that we now have a few examples of PBT in the codebase and it certainly adds some additional assurances to the correctness of the code it's testing, so subsequent issues regarding PBT can focus on more specific areas to be tested and this one can be closed.

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