On Thursday, 5 February 2015 at 08:01:06 UTC, Jonathan M Davis wrote:
the function exits, but in the vast majority of cases, what you're testing with an out contract is what unit tests would be testing, in which case, the out blocks don't really add anything, and since they're forced to be general, you can't test for specific results like you can with a unit test.

That would be true if:
- the unit test was doing exhaustive testing
- the unit test is fully specified
- the unit test is proven correct

But post conditions that are part of a specification can in theory be used for optimization when you link object files from different sources. So you can change the implementation of one object file with only linking as long as the specification itself does not change. Well, if you had a separate specification...

Reply via email to