------ art_16624_9458888.1141597165291 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 3/5/06, Esad Hajdarevic <esad.spammenot / esse.at> wrote: > > Hi! > > I talked to few fellow ruby programmers, and most of them agreed that > unit tests are the place where the asserts should be placed, however in > my own opinion, unit tests mostly never cover everything and asserts in > development versions ($DEBUG) are very handy. What is your opinion? > > Esad > > asserts in code are good to ensure preconditions and postconditions of methods. this is "design by contract". asserts in unittests can often only be used to check postconditions of the tested methods. i prefer precondition asserts in debug code that get filtered out by a preprocessor in the release version (hence no performance cost). i often have the assertions followed by errorhandling code that tries to handle the same issues gracefully in release code. -- henon ------ art_16624_9458888.1141597165291--