Software testing (source code)

= Software testing

<Software testing> executes a program under specified conditions and compares its behaviour with an expected result or property. A unit test may check one <function>; an <integration> test checks interacting parts; a regression test guards against recurrence of a known failure. For a sorting routine, useful properties include ordered output and preservation of the input multiset. Passing finitely many tests cannot generally prove correctness for every input. The choice of cases and the quality of the test oracle determine what evidence a test actually supplies.