Wednesday, June 29, 2011

Java Assert

The assert keyword is mainly used for unit testing, enabling you to test variable (value) assumptions of your program during runtime. Assert checking could be enabled by configuring "-ea" on VM options - otherwise assert statements would be ignored. With the use of assert, you will be able to pin point potential bugs faster.



In practice I don't often use assert; so prolly I'm writing this entry to change that.

No comments:

Post a Comment