Is there a rust way for doing TDD?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • regex

    An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

    4: I don't think most projects measure coverage, but generally speaking all popular Rust projects have some tests. Have a look at regex, rustup or nushell.

  • Rustup

    The Rust toolchain installer

    4: I don't think most projects measure coverage, but generally speaking all popular Rust projects have some tests. Have a look at regex, rustup or nushell.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • nushell

    A new type of shell

    4: I don't think most projects measure coverage, but generally speaking all popular Rust projects have some tests. Have a look at regex, rustup or nushell.

  • tarpaulin

    A code coverage tool for Rust projects

    There is https://github.com/xd009642/tarpaulin for code coverage, but I'm not sure how widely it's used.

  • proptest

    Hypothesis-like property testing for Rust

    It is not hard to do TDD with integration tests either, just write tests that encapsulate the properties you want your library to hold then implement those properties one by one. This is also known as property driven/based testing which then couples well with fuzzers or randomized testing where you randomize the input rather than using large amounts of test assets. This also help you catch a lot more bugs that you never even thought of. proptest is a good library that can help with this.

  • zero-to-production

    Code for "Zero To Production In Rust", a book on API development using Rust.

    The Zero2Prod book has a pretty good chapter on testing. The whole book follows basic TDD principals and I can recommend taking a look at it. Some of the chapters of the book are available on the authors blog for free, but it's probably well worth the money.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts