Darren New wrote:
> Thinking on it a bit, it sounds like unit testing is just a way to add
> Eiffel-style programming-by-contract to your code without any actual
> language support for it.
I thought the term was "design by contract"?
Well whatever. Contracts seem like a nice idea; you make it clear who's
supposed to check for error conditions - whether it's supposed to be the
caller or the callee. And you can enforce it by enabling checks at
runtime. Having said that, I don't recall using it much myself in my own
code.
On top of that, any kind of testing is going to be easier if a
function's output depends only on its current inputs...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|