An Introduction to Property-Based Testing with JavaScript

Property-based testing is a powerful technique that’s been widely and successfully applied to functional-style codebases for a long time. As functional programming continues to get more and more popular among JavaScript developers, the value of this style of testing is becoming more obvious to a wider audience.

Evaluating Property-Based Testing Through a Random Walk

Lately, I’ve been interested in property-based testing. It’s a sort of “Monte Carlo”-esque approach where you execute your application randomly (rather than according to strict scripts) and test that it never reaches an invalid state. It has proven usefulness in lower-level software (such as implementations of data structures), but I’ve been wondering if it could […]

Fuzz Testing with afl-fuzz (American Fuzzy Lop)

Last year’s wave of major network security vulnerabilities has kept adversarial testing on my mind. Security auditing tools can discover bugs which are missed during more general testing. In particular, my interest was piqued by American fuzzy lop, a fuzzer released by the Google security team, and I’ve been waiting for the right project to try […]

QuickCheck in Ruby

Scott recently posted about the theft property-based testing library in C. Theft is very similar to Haskell’s QuickCheck. Theft tends to have a little less magic than Quick Check for generating random input and for failure case reduction. Theft makes them more manual, but also gives you better control of how they work. The theft […]

Property-Based Testing – Testing Assumptions You Don’t Know You’re Making

Finding good test input can be tricky. Even with loads of unit tests, bugs still get through. Consider a wear-leveling algorithm for flash memory — it takes a series of write operations and spreads them over the flash, because individual blocks can only be written and erased so many times before they wear out. If […]