|
|
Chambers wrote:
> I wasn't aware that the two were mutually exclusive.
In some sense, I think.
> Programming by contract creates the specification for your code.
Sort of, yes. More precisely, it formalizes the unit level of semantics of
what your code is expected to do.
> TDD ensures that your code meets that specification.
Not TDD. TDD is "the test is the specification." If it passes the test, you
don't change anything, and if it doesn't, it's broken by definition.
If your compiler could check your PbC was upheld by the implementation,
would you need a test? If your test code tests something (and expects
success) from something the PbC says should fail, which is right?
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
|