> but a human still has to read that code and make sure that it does what you think it does.
Why not just write tests instead? If you have 100% test coverage, would you care about the code?
Why not just write tests instead? If you have 100% test coverage, would you care about the code?
add a b = 2
test_add = assert_equals (add 1 1) 2
A more useful definition of coverage would be the entire possible state of the program, but this is tantamount to a proof, which is a really hard problem for programs in general. Property based testing, e.g. QuickCheck[1], gets us close, but it is often hard to come up with the right properties.