Assertions should be more debugger-oriented
nullprogram.com
nullprogram.com
1. Invariant assurance when entering/exiting an operation.
2. Argument checking. Enforcing requirements as to how an API is to be used.
3. Documenting the state of an operation as it proceeds. This is a kind of logging.
4. Acting like a kind of insiders (pre-)unit-testing. Ensuring certain assumptions are not violated as a function is put together, or as it evolves in the future.
I consider debugging, manual (initial) testing, automated testing, asserts, logging, long-term monitoring, and even commenting as somewhat related. But I don't know the best way to unify these things or even if that's desirable.