This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
All these quotes are taken from Dan site, in true/false pattern. But I want to know what it is and how can we identify by seeing the code that assert has been used as to check control flow invairant/postcondition/precondition/class variant/internal variant
The assert statement is being used to check a control-flow invariant to verify that the control flow never reaches a point in the program.
The assert statement is being used to check a class invariant--something that must be true about each instance of the class
The assert statement is being used to check an internal invariant--something that the programmer assumes to be true at a particular point in the program
The assert statements are being used to check a precondition--something that must be true when the method is invoked.
The assert statement is being used to check a postcondition--something that must be true when the method completes successfully.
can anyone explain the above thing with coding? Whether assertion can be used to check control flow invariant, postcondition and precondition (all the three condition I don't know)
pls explain [ December 15, 2006: Message edited by: Micheal John ]
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT