0 day streak

Software testing is writing code that checks your other code behaves as intended, so you find bugs before users do and can change things later without fear. Unit tests check one small piece in isolation and run in milliseconds; integration tests check that pieces work together, like your code talking to a real database; end-to-end tests drive the whole app the way a user would, and are slow and more fragile. The usual advice is a “pyramid”: many unit tests, fewer integration tests, a handful of end-to-end ones. Property-based testing goes further by generating hundreds of random inputs and checking a rule holds, then shrinking any failure to the simplest example.

In this lesson: Pyramid cards and a property-based test that shrinks to the minimal failing input.