Introduction object-oriented programming
peter at engcorp.com
Sun Jan 19 15:54:35 CET 2003
Donnal Walter wrote:
> [OT] One of Eiffel's strengths is design by contract (DBC). I've considered
> implementing one of the published recipes for EiffelMethods in Python, but I
> wonder, is DBC is really necessary if one uses unit tests compulsively?
Not having really studied DBC, I couldn't say, but I wonder if maybe
DBC is more appropriate for the *external* interfaces in that case?
One cannot unit test the external interfaces, so almost by definition
the tests for one's code should include checking a lot of boundary
conditions and such, to be sure how the code reacts when sent garbage.
So even though one is using tests to drive the design, the tests are
really driving the development of the "contracts" which then drive
the design... or something meandering like that?
More information about the Python-list