Monkey Test
A property based testing (PBT) tool like QuickCheck, ScalaCheck and similar libraries, for the Rust programming language.
☝️ Warning! This library is in pre-alpha state. Large parts of functionality is missing and API will undergo a lot of change. For details on recent changes, see the CHANGELOG.
Example
Getting started
In Cargo.toml
, add
[]
= "0"
Then try some small example, like the one above.
Documentation and how-to guide
The Monkey Test DOCUMENTATION (also found on docs.rs) shows how to use the library and tries to be a complete how-to guide to using Monkey Test and property based testing in general. Additional usage examples can be found in the source file tests/basic_usage.rs and other files in test folder.
Current status and missing parts
Currently, in versions 0.x.y, the library is not ready for production use. It is among other things missing some vital parts, primarly built in generators and shrinkers for:
- Floating point numbers
f32
andf64
. - Strings.
- Commonly used data structures besides
Vec
. - Recursive data structures.
For details on recent changes, see the CHANGELOG.
Alternative libraries
There are other alternatives for property based testing in Rust. The Monkey Test library exist for mostly subjective reasons, not liking the API experience or the heavy use of macros and attributes in other libraries. Your milage may vary.
The most mature and widely adopted alternatives are Quickcheck and Proptest. Currently, if you want to have a production grade PBT library, choose one of these two. When in doubt, choose Proptest, since it allows for custom generators and shrinkers.
Some other alternatives are checkito and diceprop.
License
Monkey test uses the MIT license.
Contributions
This library needs feedback from users to become even better. Feel free to open a Github issue or open a Github pull request.
All work in Monkey Test is licensed under the terms of the MIT license. By submitting a contribution you are agreeing to licence your work under those terms.