There are things we are supposed to do that we don't. Exercise. Avoiding fast foods. Use the assert() macro. Exercise is a real pain that requires time and effort. Fast food can save time, and is carefully designed to seduce us. But asserts take little time or effort, and yet are as rare as the spotted owl. The Linux kernel sports just one thousand invocations of the macro in three million lines of code, an assertion density of just one per 3KLOC.
Historically, though, there's been little good evidence they are effective. Till now. In a paper from Microsoft Research the authors compared the relationship between the density of the assertions and code quality.
Embedded.com - The Use Of Assertions