It is mathematically established, since Alan Turing's famous 1937 paper "On Computable Numbers", that no general method can exist for one program or algorithm to prove that another one is correct.
It is also a nice philosophical problem, since in every special case where such a proof has been constructed, the program was very simple and the proof was very complicated. So if one could not see that the program was correct, before the proof, how could one then claim to see that the proof was correct? And if one can, indeed, see that the proof is correct, what use is it, because one could far more easily see that the program was correct to begin with.
2007-06-13 01:13:54
·
answer #1
·
answered by Anonymous
·
0⤊
0⤋
You'd pretty much have to work it out by hand, if that were even possible. For large problems, verify that the parts work and hope nothing strange emerges when the parts are integrated.
But
1. no program works the first time
2. every program can be improved
3. you never find the last bug.
You should hunt down John Gall's "Systemantics: How Systems Work but Mostly How They Fail." Here's a related link.
2007-06-13 01:20:47
·
answer #2
·
answered by Philo 7
·
1⤊
1⤋
It depends on what kind of program you are talking about. If it is a math program then you have to solve it by hand, and compare the answers. Otherwise you would have to be able to look at the program itself.
2007-06-13 02:05:04
·
answer #3
·
answered by bmhk7925 3
·
0⤊
1⤋
Run the program with data for which you know the outcome. Also run the program with data that could potentially make it crash to check for error-handling.
2007-06-13 01:17:31
·
answer #4
·
answered by Anonymous
·
1⤊
1⤋
test the program with some data
2007-06-13 01:20:29
·
answer #5
·
answered by Lucky 3
·
0⤊
1⤋
Run the program and see if it achieves what it is supposed to do...
2007-06-13 01:22:21
·
answer #6
·
answered by detektibgapo 5
·
0⤊
1⤋
Run the program and see!!As simple as that!!!!
2007-06-13 01:19:17
·
answer #7
·
answered by Annie 1
·
1⤊
1⤋
Run it, yup, that's the only way--unless you mean "prove" in some kind of academic sense in which you could say, "See, the code's all right! . . ." and leave it at that.
2007-06-13 01:21:05
·
answer #8
·
answered by supastremph 6
·
0⤊
1⤋