Hacker News new | ask | show | jobs
by rigille 1773 days ago
Unit tests are theorems too! When you compute `Test(x)` and check it's `true` you have proven the theorem `Test(x) == true`. However that's only about a specific choice of `x`. Theorems allow you to use math to test all choices of `x` and cover infinitely many test cases.

In theory you could even write an unit test and offer a bounty to the first to write a function that's proven to pass it. So you wouldn't need to write it or review the results for correctness.