http://qs1969.pair.com?node_id=270332


in reply to Testing by Contract

  1. ...Class::Contract is specifically tied to the concept of classes...

    This is also mentioned in the Class::Contract POD under "Offering better facilities for retrofitting contracts".

    Yep. This a cross-cutting concern that should not be tangled with a class definition framework. Such concerns are best untangled using the Aspect module. Of course it may be difficult to provide all the DBC features Class::Contract provides, like old() and inheritance support.

  2. See "A simple and practical approach to unit testing: The JML and JUnit way" for some work on going from assertions to tests, and a bibliography.