Before learning Perl I wrote some software in Eiffel, and they had that "Design by Contract" paradigm very early, and I used it extensively.

It helped, but it didn't replaced tests.

Why? Because the code has to be run in order to check these precoditions, postconditions, class invariants etc.

And if a method isn't called during testing, all your assertions are vain.

I ended up rerunning the application all over just to make sure these assertions were executed and checked. But the test suite should have done that, not me manually.

There's nothing wrong with DBC (and I like the fact that Perl 6 will come with it by default), but it's just not enough.

In reply to Re^2: Does anybody write tests first? by moritz
in thread Does anybody write tests first? by amarquis

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":