3 ms·
> Tests aren't verification, and they cannot demonstrate correctness (without being exhaustive). Agreed, but it's important to note that there's very little th
by JadeNB 11y ago
> Tests aren't verification, and they cannot demonstrate correctness (without being exhaustive).
Agreed, but it's important to note that there's very little that can demonstrate correctness. Most type systems by themselves don't; as Pierce describes it in TAPL, "[a] type system is a syntactic method for automatically checking the absence of certain erroneous behaviors" (emphasis mine). It's possible that, in a dependent type system, those certain behaviours will be sufficiently many that you can prove the correctness of a program specification, but even a rich system like Haskell's usually doesn't offer such guarantees (just consider `tail []`; or, for an example that's not just a Prelude wart, `take n xs`).
- nmrm2 11y agoIt's difficult to demonstrate full functional correctness. However, it is pretty easy to demonstrate partial correctness. Most tests -- even if they were completely exhaustive -- correspond to partial correctness rather than functional correctness.