What do we mean by soundness and completeness of algorithms?

Soundness and completeness are two desirable properties that are used in multiple domains. This article specifically focuses on the soundness and completeness of an algorithm, nonetheless, the basic idea can be extended further to other domains.

Soundness of an Algorithm:

An algorithm is said to be sound if every time the answer is true, it returns true.  Soundness, however, does not say anything about the answers that are false, and hence, the algorithm may return either true or false for an answer that is false. In other words, soundness allows for false positives. 

The easiest way to write a sound algorithm is to always return true.


For example, Dynamic Partial Order Reduction (DPOR) techniques are sound since they replay all distinct program behaviors. 


Completeness of an Algorithm:

Completeness of an algorithm, on the other hand, assures that if the algorithm returns true, the answer is also true. A complete algorithm may have false negatives. Any algorithm that always returns false can be deemed as complete.



For example, consider any IDE like Eclipse that shows warnings for potential bugs. Since every warning given is indeed true but the IDE fails to capture all bugs, it is complete.

Guaranteeing soundness, as well as completeness in a single algorithm, is expensive, and therefore most algorithms have only one of these two properties depending on the requirement.