Assert(): The Underused Tool for Correct, Safe Code
Assert(): A Modern How To
Assertions are often misunderstood and underused. This article clarifies when and where to use them, covering four key areas: correctness, safety, development, and documentation. It argues that assertions provide 100% value coverage, prevent silent breakage, and have negligible overhead. The author also proposes an ideal assertion API with production and development variants, dynamic messaging, and stack dumps.
A failed assertion is behaving exactly as you intended, it correctly caught an edge case.