Want this course?
Testing pure functions
Pure functions are the easiest things to test. You can run them as many times as you want without fear of side effects. In this long episode, watch over my shoulder as I test five different functions. Three of the functions are fairly mathematical, so they're pretty straightforward. But two are copied from real-world code. You'll get to see the raw process, right here.
When to test: before implementation
In this lesson, we implement a function using TDD. Property-based testing is great for doing TDD since the tests are constantly giving you small examples that fail, one at a time. Make it pass, and get another. Make that pass, get another. Eventually, you'll have the whole thing tested and implemented.