Unit testing... Everyone knows what it is. However, when ever I try, I feel like I ended up wasting a lot of time and feel that my tests do nothing. Even worst, I feel like I cannot write tests for many things that I feel are important.<p>How can one learn to do proper unit testing? I see bunch of examples but none that really help me. I almost feel like a unit testing needs to be taught and hard to learn on your own.
Unit testing is all about abstracting / mocking out all the modules connected to the unit you are testing & just test your unit.<p>If you are programming in python, <a href="http://www.voidspace.org.uk/python/mock/" rel="nofollow">http://www.voidspace.org.uk/python/mock/</a> would be the most preferred way of mocking out other external units connected to your unit under test.<p><a href="http://alexmarandon.com/articles/python_mock_gotchas/" rel="nofollow">http://alexmarandon.com/articles/python_mock_gotchas/</a> should make you an expert on mocking