isA function?
Roy Smith
roy at panix.com
Sun Jul 14 21:06:40 EDT 2002
"Delaney, Timothy" <tdelaney at avaya.com> wrote:
> What would be more useful though is to simply try to use the functionality.
> If it works, why is there a need for it to be a particular type? If an
> attribute is missing, the unit test will fail. If the semantics are wrong,
> and it passes, the unit test needs an additional case added.
But, what you're arguing is that the API is defined wrong, not that the
unit test is written wrong. If the API says, "foo() returns an object
of class bar", then it's the right thing for the unit test to determine
if, indeed, foo() returns an object of class bar.
Now, if you want to tell me that I should change the definition of foo()
in the API to be, "returns something which has these three methods and
these seven data items", well, OK, that's might be a point worth
arguing. But, it's not the job of the unit test writer to decide that
the API isn't designed right.
More information about the Python-list
mailing list