ASSERT - “Assert is a comment that cannot lie.” - Documents what you expect to be true… and enforces that it *must* be true. - If the condition is false, then program will crash---and that is very good. - Helps you catch a problem close to the source (i.e., the mistake in your code). - Code can test itself as it runs. - Assert is not a substitute for unit testing. - It is a supplement to your testing. - It is a better way to write comments that state what should be true at a certain line. How to use: - #include - assert(«condition»); - condition must be true if the code is correctly written (i.e., no mistakes). - condition should be something that YOU have complete control over. Do not use assert… - To check arguments passed from external code (i.e., other people's code). - To check environmental conditions (e.g., file exists, file is readable, etc.). Assert is a programming thing, not a C-specific thing.