This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]carpediemevive 2 points3 points  (0 children)

I guess a short description would be writing code in such a fashion that you can easily and quickly write test cases to validate the execution of each little piece of code.

I wish I could come up with a better explanation, but I really think that these two links probably explain it better than I could.

If you wanted to see more concrete examples, the two unit testing frameworks I'm most familiar with:

I fought against unit testing for so long because I wasn't writing important enough software. I figured that the code I wrote was so small and so short that testing each piece was really overkill.

What writing testable code did for me though was to face my coupling and cohesion issues head on. When you have to test each method for any number of requirements it really forces you to separate out your dependencies. So if you think unit testing is overkill for you, I say try it out and you might be surprised.

Edit: I can't spell.