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).