in reply to RFC: Test::Contract - extensible object-oriented runtime check series
With DbC, contracts are actually part of the code, not secondary constructs like unit tests. Contracts and unit tests are different, 'orthogonal' ways of verifying code. Contracts can be enabled/disabled at run time, and you wouldn't test the contract as such, though you could have tests that exercise typical workflows and contract violations would show up as exceptions being raised.
Also contracts in this sense are not meant to validate data, but to verify an object API is working as agreed.
Some modules that support DbC: Class::Contract, MooseX::Contract.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: RFC: Test::Contract - extensible object-oriented runtime check series (DbC)
by Dallaylaen (Chaplain) on Dec 26, 2017 at 16:49 UTC |