Part 11 – Property Tests
This is a series of posts I’m writing about using types as another tool in software development, Continuous Delivery, & keeping LLM’s honest. They’re also a design & refactoring tool, a communication tool, and reduce how many tests you have to write.
Parts


We’ve got more than enough type knowledge to build total functions. Type safety is a spectrum; is there a way to determine how total our functions are? A few. One particular way is to utilize Property Tests. You write a single unit test, it generates 100 random inputs. If one of those inputs fails, it’ll give you the random seed so you can test the exact sequence of inputs yourself (e.g. fast-check, jsverify):
(more…)




