Re: Unit tests and parameter validation

Tim Ottinger <[email protected]>
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <CAN2NSt=0EzwpOPYobkfHNcJTpDGhdmCu-fZN4NcjDNUbeynR=Q@mail.gmail.com>
Where does that data come from?

Programmers or external sources?

Development time or runtime?

I don't test against programmers but might test if data comes from a file
or database. Humans can figure out when they're wrong, especially if they
write tests.

Of course I worry a bit more if the parameters are not type-safe and/or the
ordering of parameters is not obvious and natural.

So that leaves the last question as whether the interface invited advise.
On Oct 16, 2013 12:03 AM, "Eb" <[email protected]> wrote:

>
>
> Hello everyone -
>
> I'm curious to know thoughts on writing tests that specify the behavior of
> a method when its inputs are incorrect.  Is this a common practice.  How
> about parameter validation in this case?  Having some healthy debate on it
> and wanted to get other insight.
>
> The context for this in a class/methods that are used within an internal
> application - this is not an API that will be publicly exposed to external
> consumers.
>
> Thanks.
>
> --
> blog: http://eikonne.wordpress.com
> twitter: @eikonne
>
>
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.