proptest
serde
| proptest | serde | |
|---|---|---|
| 18 | 206 | |
| 2,153 | 10,609 | |
| 2.1% | 0.4% | |
| 8.0 | 8.4 | |
| 16 days ago | 10 days ago | |
| Rust | Rust | |
| Apache License 2.0 | Apache License 2.0 |
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
-
Testing in Rust: from cargo test to mocking HTTP calls
As for third-party stuff, the usual suspects in dev-dependencies are pretty_assertions (a diff instead of a wall of text when comparing big structs) and proptest - property-based testing, where you describe an invariant and the library generates hundreds of inputs and shrinks the counterexample for you. Some people prefer quickcheck, it's older and simpler. For snapshots there's insta. Async tests get wrapped in #[tokio::test].
- Proptest: Property-based testing for Rust (inspired by Hypothesis)
-
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.
serde
- Serde
-
A Noob's Journey to Blockchain Development in Rust
Serde: https://serde.rs/
- Serde (Rust Serialization Deserialization)
-
Web Developer Travis McCracken on The Simplicity of Net/HTTP in Go
One key challenge was managing data serialization and deserialization. Rust’s serde library made this process straightforward, allowing me to write custom serializers that minimized CPU usage. The result is a server that outperforms comparable implementations in other languages, especially under heavy load.
-
REST API in RUST with ntex
serde
-
Zig, Rust, Go?! I tried 3 low-level languages and here’s what I’m sticking with
Serde for serialization
-
Serde Integration With the MongoDB Rust Driver
We just scratched the surface of what is possible with Rust, MongoDB, and Serde today. Just as a quick reminder, great documentation exists for the MongoDB crate, Serde, and actix-web.
-
A 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
You misunderstood. Game developers should use a _good_ third–party library, not a _bad_ one. At a minimum they should be able to read the source code so that they know it is good. Thus open source libraries should be at the top of the list.
If you don't know what “good” looks like, take a look at [Serde](https://serde.rs/). It’s for Rust, but its features and overall design are something you should attempt to approach no matter what language you’re writing in.
-
Is Rust a good fit for business apps?
We have written our own http server framework focused on openapi support: https://docs.rs/dropshot/latest/dropshot/
https://serde.rs/ is the serialization/deserialization framework in Rust, and is well supported in the ecosystem.
We also wrote https://github.com/oxidecomputer/oxide.ts to generate TypeScript clients from the OpenAPI.
We mostly use react-router (or remix for older things that haven't been upgraded yet).
So the way that it works is, you define your api in dropshot. You ask it to generate an openapi document. You run this on that document to get a typescript client. And then you use that client in your react-router application.
I'm personally using it in the "framework" mode, so I have a "backend for frontend" going on, but the main appliccation is using it purely on the client, served from the same server as that API. Both have pros and cons.
-
Rusty Backends
If the request parameter cannot be parsed, the appropriate response code is sent instead of calling the function, so we have the usual comfort of type safety. Request bodies are handled very similarly, and of course, parsing integrates seamlessly with serde.
What are some alternatives?
quickcheck - Automated property based testing for Rust (with shrinking).
rust-asn1 - A Rust ASN.1 (DER) serializer.
polish - Testing Framework for Rust
bincode - A binary encoder / decoder implementation in Rust.
afl.rs - 🐇 Fuzzing Rust code with American Fuzzy Lop
msgpack-rust - MessagePack implementation for Rust / msgpack.org[Rust]