Assertions can be used for checking a conditional branch that should not be reached...
This makes for e and f. b is a generalization of both.
Notice that with the assertion we check a conditional result not that we have reached the beginning or end of a method.
In
Control flow invariants from Programming with Assertions we check a conditional, not any other point in a method.
The examples above are from The
Java 1.4 Tutorial by Gregory M. Travis , which says "Do use (assertions) to check for conditional cases that should
never happen" . Not for the flow of control reaching any point in a method.
a is true as a general assertion guideline, but not for the "control flow invariant"