What's a unit test? [closed]
- by Tyler
Possible Duplicates:
What is unit testing and how do you do it?
What is unit testing?
I recognize that to 95% of you, this is a very WTF question.
So. What's a unit test? I understand that essentially you're attempting to isolate atomic functionality but how do you test for that? When is it necessary? When is it ridiculous?
Can you give an example? (Preferably in C? I mostly hear about it from Java devs on this site so maybe this is specific to Object Oriented languages? I really don't know.)
I know many programmers swear by unit testing religiously. What's it all about?
EDIT: Also, what's the ratio of time you typically spend writing unit tests to time spent writing new code?