3 ms·
Unit tests almost never prove correctness or completeness. For a non-trivial program, the best you can hope to demonstrate is correctness for the arguments tes
by stephencanon 11y ago
Unit tests almost never prove correctness or completeness. For a non-trivial program, the best you can hope to demonstrate is correctness for the arguments tested in the state determined by the test environment. If you want to prove correctness, you need proofs.
By and large, unit tests exist to quickly find bugs.
- mrbrowning 11y agoAs I like to put it: unit tests don't affirm the correctness of code with respect to a specification, they merely affirm that certain implications of the specification hold with the code under test. In that sense, the general tendency to assume correctness in the face of passing test suite is basically an instance affirming the consequent on a huge scale.
- deleted 11y ago[deleted]