Re:Loop invariants can give you coding superpowers
by ramtatatam on Wednesday April 03, 2019 @06:46PM
(#19567860)
To prove the correctness of your code you would write tests in similar way as SQLite does, no? They have, like, 100x more lines of code for tests than actual code they test?
[ Parent
| on HN ]
Re:Loop invariants can give you coding superpowers
by jacobajit on Wednesday April 03, 2019 @06:56PM
(#19567912)
Test cases do not establish proof.
There could always be another rare edge case.
Re:Loop invariants can give you coding superpowers
by mabbo on Thursday April 04, 2019 @07:45AM
(#19571007)
Unit tests demonstrate correctness. That's another useful tool in the tool box. But proofs are more than just that.
Imagine trying to unit test all possible cases of Pythagorean theorem being correct vs a single proof in a few lines of descriptive logic.
Re:Loop invariants can give you coding superpowers
by heartofgold on Wednesday April 03, 2019 @11:12PM
(#19569032)
What jacobajit said. Or here's what Dijkstra said:
"Program testing can be used to show the presence of bugs, but never to show their absence!"
Dijkstra (1970)