Why can't programs be proven?

前端 未结 30 2333
礼貌的吻别
礼貌的吻别 2020-12-22 17:06

Why can\'t a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and

30条回答
  •  天涯浪人
    2020-12-22 17:52

    If you are looking for confidence, the alternative to proving programs is testing them. This is easier to understand and can be automated. It also allows for the class of programs for which proofs are mathematically not possible, as described above.

    Above all, no proof is a substitute for passing acceptance tests:*

    • Just because a program really does do what it says it does, doesn't mean it does what the user wants it to do.

      • Unless you can prove that what it says it does is what the user says they want.

        • Which you then have to prove is what they really want, because, being a user, they almost certainly don't know what they want. etc. Reductio ad absurdum.

    *not to mention unit, coverage, functional, integration and all the other kinds of tests.

    Hope this helps you on your path.

提交回复
热议问题