In computer science, correctness is the extent to which an algorithm will halt (i.e., it finishes computations in finite time) and outputs the correct solution for every input.
We can prove correctness with:
- Basic proof techniques, like counterexample, contraposition, or contradiction
- Proof by induction
- Loop invariant