in reply to Is validation of all subroutine arguments overkill?

Do you think it's worth the time to write tests to ensure subroutines handle bad arguments?

What is the likelihood of a particular subroutine being passed bad arguments?

If those arguments are sourced from data outside of your programs control, and that data will not have passed any other validation before being passed to this subroutine, then validating is not just worth the time, but (IMO) imperative.

On the other hand if the subroutine can only be called with data that has already been validated, its pointless.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Is validation of all subroutine arguments overkill?