请输入您要查询的百科知识:

 

词条 Correctness (computer science)
释义

  1. See also

  2. Notes

  3. References

{{Use dmy dates|date=April 2017}}

In theoretical computer science, correctness of an algorithm is asserted when it is said that the algorithm is correct with respect to a specification. Functional correctness refers to the input-output behaviour of the algorithm (i.e., for each input it produces the expected output).[1]

A distinction is made between partial correctness, which requires that if an answer is returned it will be correct, and total correctness, which additionally requires that the algorithm terminates. Since there is no general solution to the halting problem, a total correctness assertion may lie much deeper. A termination proof is a type of mathematical proof that plays a critical role in formal verification because total correctness of an algorithm depends on termination.[2]

For example, successively searching through integers 1, 2, 3, … to see if we can find an example of some phenomenon—say an odd perfect number—it is quite easy to write a partially correct program (using long division by two to check n as perfect or not). But to say this program is totally correct would be to assert something currently not known in number theory.

A proof would have to be a mathematical proof, assuming both the algorithm and specification are given formally. In particular it is not expected to be a correctness assertion for a given program implementing the algorithm on a given machine. That would involve such considerations as limitations on computer memory.

A deep result in proof theory, the Curry-Howard correspondence, states that a proof of functional correctness in constructive logic corresponds to a certain program in the lambda calculus. Converting a proof in this way is called program extraction.

Hoare logic is a specific formal system for reasoning rigorously about the correctness of computer programs.[3] It uses axiomatic techniques to define programming language semantics and argue about the correctness of programs through assertions known as Hoare triples.

Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results. Although crucial to software quality and widely deployed by programmers and testers, software testing still remains an art, due to limited understanding of the principles of software. The difficulty in software testing stems from the complexity of software: we can not completely test a program with moderate complexity. Testing is more than just debugging. The purpose of testing can be quality assurance, verification and validation, or reliability estimation. Testing can be used as a generic metric as well. Correctness testing and reliability testing are two major areas of testing. Software testing is a trade-off between budget, time and quality.[4]

See also

  • Formal verification
  • Design by contract
  • Program analysis (computer science)
  • Model checking
  • Compiler correctness
  • Program derivation

Notes

1. ^{{Cite journal | last1 = Dunlop | first1 = Douglas D. | last2 = Basili | first2 = Victor R. | authorlink2 = Victor Basili | title = A Comparative Analysis of Functional Correctness | doi = 10.1145/356876.356881 | journal = Communications of the ACM| volume = 14 | issue = 2 | pages = 229–244 | date=June 1982 | url = https://dl.acm.org/ft_gateway.cfm?id=356881}}
2. ^{{Cite journal | last1 = Manna | first1 = Zohar | last2 = Pnueli | first2 = Amir | title = Axiomatic approach to total correctness of programs | doi = 10.1007/BF00288637 | journal = Acta Informatica| volume = 3 | issue = 3 | pages = 243–263 | date=September 1974 | url = https://link.springer.com/content/pdf/10.1007%2FBF00288637.pdf}}
3. ^{{Cite journal | last1 = Hoare | first1 = C. A. R. | authorlink1 = C.A.R. Hoare | title = An axiomatic basis for computer programming | doi = 10.1145/363235.363259 | journal = Communications of the ACM | volume = 12 | issue = 10 | pages = 576–580 | date = October 1969 | url = http://www.spatial.maine.edu/~worboys/processes/hoare%20axiomatic.pdf | deadurl = yes | archiveurl = https://web.archive.org/web/20160304013345/http://www.spatial.maine.edu/~worboys/processes/hoare%20axiomatic.pdf | archivedate = 4 March 2016 | df = dmy-all | citeseerx = 10.1.1.116.2392 }}
4. ^{{cite web |url=http://www.ece.cmu.edu/~koopman/des_s99/sw_testing/ |title=Software Testing |last=Pan |first=Jiantao |publisher=Carnegie Mellon University |access-date=21 November 2017 |date=Spring 1999 |type=coursework}}

References

  • "Human Language Technology. Challenges for Computer Science and Linguistics." Google Books. N.p., n.d. Web. 10 April 2017.
  • "Security in Computing and Communications." Google Books. N.p., n.d. Web. 10 April 2017.
  • "The Halting Problem of Alan Turing - A Most Merry and Illustrated Explanation." The Halting Problem of Alan Turing - A Most Merry and Illustrated Explanation. N.p., n.d. Web. 10 April 2017.
  • Turner, Raymond, and Nicola Angius. "The Philosophy of Computer Science." Stanford Encyclopedia of Philosophy. Stanford University, 20 August 2013. Web. 10 April 2017.
  • Dijkstra, E. W. Program Correctness. Austin, Texas?: U of Texas at Austin, Departments of Mathematics and Computer Sciences, Automatic Theorem Proving Project?, 1970. Web.

2 : Formal methods terminology|Theoretical computer science

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/30 1:43:31