←back to thread

371 points ulrischa | 7 comments | | HN request time: 0.961s | source | bottom
Show context
layer8 ◴[] No.43235766[source]
> Just because code looks good and runs without errors doesn’t mean it’s actually doing the right thing. No amount of meticulous code review—or even comprehensive automated tests—will demonstrably prove that code actually does the right thing. You have to run it yourself!

I would have stated this a bit differently: No amount of running or testing can prove the code correct. You actually have to reason through it. Running/testing is merely a sanity/spot check of your reasoning.

replies(4): >>43235828 #>>43235856 #>>43236195 #>>43236756 #
1. nnnnico ◴[] No.43235856[source]
not sure that human reasoning actually beats testing when checking for correctness
replies(4): >>43235988 #>>43236031 #>>43237608 #>>43239891 #
2. ljm ◴[] No.43235988[source]
The production of such tests presumably requires an element of human reasoning.

The requirements have to come from somewhere, after all.

replies(1): >>43241552 #
3. layer8 ◴[] No.43236031[source]
Both are necessary, they complement each other.
4. fragmede ◴[] No.43237608[source]
Human reason is fine, the problem is that human attention spans aren't great at checking for correctness. I want every corner case regression tested automatically because there's always going to be some weird configuration that a human's going to forget to regression test.
replies(1): >>43240867 #
5. Gupie ◴[] No.43239891[source]
"Beware of bugs in the above code; I have only proved it correct, not tried it."

Donald E. Knuth

6. sarchertech ◴[] No.43240867[source]
With any non trivial system you can’t actually test every corner case. You depend on human reason to identify the ones most likely to cause problems.
7. MrMcCall ◴[] No.43241552[source]
I would argue that designing and implementing a working project requires human reasoning, too, but that line of thinking seems to be falling out of fashion in favor of "best next token" guessing engines.

I know what Spock would say about this approach, and I'm with him.