Invariants
An invariant is a condition that is always True at a particular point in an algorithm.
For example, an invariant for factorial function above can be specified after else as shown below:
else //INV: N > 0, so N-1 >= 0
Write invariants as documentation for your code.