proptest
hypothesis
proptest | hypothesis | |
---|---|---|
16 | 25 | |
1,898 | 7,913 | |
0.9% | 0.5% | |
7.8 | 9.9 | |
26 days ago | 10 days ago | |
Rust | Python | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proptest
-
Proptest: property testing in Rust
In this post, I will tell you how I used property testing with the Proptest library in Rust to ensure the correctness of a bunch of generated serialization/deserialization code for the Apache Kafka protocol.
-
What Are The Rust Crates You Use In Almost Every Project That They Are Practically An Extension of The Standard Library?
proptest: Property-based testing with random input generation.
-
Iterating on Testing in Rust
Isn't proptest something that could handle this?
https://github.com/proptest-rs/proptest
-
Proptest strategies the hard way
Proptest is a Rust crate for property-based testing. Recently I wanted/needed to manually implement a proptest strategy for my own type, and I realized that there is not that much material on how to do it. So I wrote a post where I tried to describe what I learned. It's a bit niche, but I hope that someone at some point will find it useful.
-
Generating combinatorial test cases
Take a look at proptest.
-
How to express Contracts in Rust?
Yes exactly, you can also add to this fuzzing and property based testing.
-
The birth of a package manager [written in Rust :)]
proptest is great! It generates random input data according to some rules, and if the input fails it saves random seed into a file so that failing inputs are guaranteed to be tested on the subsequent runs (as well as new random inputs). It also doesn't immediately stop on fail but tries to find a minimal failing input first.
-
Hey Rustaceans! Got a question? Ask here (11/2023)!
The only other crate I could find is proptest, but it looks a lot more complicated, and I don't know if lets you skip the shrinking step as quickcheck does. I've been reading the book and going through the docs, but a quick answer would be appreciated.
-
Announcing Proptest 1.1.0
We just released proptest 1.1.0, a property-testing framework for Rust. Proptest has recently found new maintainers, and this marks the first new release of proptest in ~2 years.
-
Hey Rustaceans! Got a question? Ask here! (32/2022)!
Hi, I'm working on a fuzzer, that fuzzes APIs based on OpenAPI specification. I'd like to implement shrinking. It means that when an interesting input (for the API) is found, I'd like to create the smallest possible input that still causes the same behaviour of the API. I'd like to implement a payload generation via proptest, because it already has the shrinking ability. I'm having issues implementing the JSON object as a proptest strategy. Here is what I tried so far. I explained it in a detail in stackoverflow question but it did not reach many people. Thanks for your help!
hypothesis
- Falsify: Hypothesis-Inspired Shrinking for Haskell
-
Property-Based Testing for the People
The python package Hypothesis[0] already does a great job bringing property-based testing to the people! I've used it and it's extremely powerful.
[0]: https://github.com/HypothesisWorks/hypothesis
-
Proptest: property testing in Rust
There's more to Proptest that I wrote in this post (but not much more), please check the documentation. But I hope this practical introduction will help you get started with the library in your projects. Also, check out similar libraries for different languages like the mentioned Hypothesis for Python or jqwik for Java.
-
Beyond Traditional Testing: Addressing the Challenges of Non-Deterministic Software
Let look at an example of property-based testing using the Hypothesis library in Python:
-
The sad state of property-based testing libraries
Anecdotally, I had a fantastic experience with `clojure.spec.alpha` (with or without `test.check`), and when I went to use python's `hypothesis` it was just... abysmal.
It seems like Hypothesis is unable to handle simple but "large" data sets >>by design<<, where "large" is really not so large. [0] It was such a pain that we ripped out Hypothesis (and generative testing altogether, sadly) completely from our python test suite at work.
[0] https://github.com/HypothesisWorks/hypothesis/issues/3493
- Hypothesis
-
A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
Hypothesis for Property-Based Testing: Hypothesis is a Python library facilitating property-based testing. It offers a distinct advantage by generating a wide array of input data based on specified properties or invariants within the code. The perks of Hypothesis include:
-
Pix2tex: Using a ViT to convert images of equations into LaTeX code
But then add tests! Tests for LaTeX equations that had never been executable as code.
https://github.com/HypothesisWorks/hypothesis :
> Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation then generates simple and comprehensible examples that make your tests fail. This simplifies writing your tests and makes them more powerful at the same time, by letting software automate the boring bits and do them to a higher standard than a human would, freeing you to focus on the higher level test logic.
> This sort of testing is often called "property-based testing", and the most widely known implementation of the concept is the Haskell library QuickCheck, but Hypothesis differs significantly from QuickCheck and is designed to fit idiomatically and easily into existing styles of testing that you are used to, with absolutely no familiarity with Haskell or functional programming needed.
-
pgregory.net/rapid v1.0.0, modern Go property-based testing library
pgregory.net/rapid is a modern Go property-based testing library initially inspired by the power and convenience of Python's Hypothesis.
- Was muss man als nicht-technischer Quereinsteiger in Data Science *wirklich* können?
What are some alternatives?
quickcheck - Automated property based testing for Rust (with shrinking).
pytest - The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
afl.rs - 🐇 Fuzzing Rust code with American Fuzzy Lop
Robot Framework - Generic automation framework for acceptance testing and RPA
trust - Travis CI and AppVeyor template to test your Rust crate on 5 architectures and publish binary releases of it for Linux, macOS and Windows
nose2 - The successor to nose, based on unittest2