How to Survive Your Project's First 100k Lines

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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

    Compiler for the Vale programming language - http://vale.dev/ (by ValeLang)

  • jumprope-rs

  • Every piece of a large program should be tested like this. And if you can, test your whole program like this too. (Doable for most libraries, databases, compilers, etc. This is much harder for graphics engines or UI code.)

    I've been doing this for years and I can't remember a single time I set something like this up and didn't find bugs. I'm constantly humbled by how effective fuzzy bois are.

    This sounds complex, but code like this will usually be much smaller and easier to maintain than a thorough unit testing suite.

    Here's an example from a rope (complex string) library I maintain. The library lets you insert or delete characters in a string at arbitrary locations. The randomizer loop is here[1]. I make Rope and a String, then in a loop make random changes and then call check() to make sure the contents match. And I check and all the expected internal invariants in the rope data structure hold:

    [1] https://github.com/josephg/jumprope-rs/blob/ae2a3f3c2bc7fc1f...

    When I first ran this test, it found a handful of bugs in my code. I also ran this same code on a few rust rope libraries in cargo, and about half of them fail this test.

  • 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.

    WorkOS logo
  • ScalaCheck

    Property-based testing for Scala

  • Regarding numbers 2 and 3, I believe you are describing "property-based testing"[0]. A Scala version of this is ScalaCheck and can be found here[1].

    There appears to be at least one Rust library which claims to provide same, but I am not a Rust developer so cannot recommend any for fitness of purpose.

    0 - https://hypothesis.works/articles/what-is-property-based-tes...

    1 - https://github.com/typelevel/scalacheck/blob/main/doc/UserGu...

  • fast-check

    Property based testing framework for JavaScript (like QuickCheck) written in TypeScript

  • Strong agree!

    For JavaScript, I suggest folks check out fast-check [0] and this introduction to property-based testing that uses fast-check [1].

    This is broadly useful, but one specific place I've found it helpful was to check redux reducers against generated lists of actions to find unchecked edge cases and data assumptions.

    [0] https://github.com/dubzzz/fast-check

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