Unit testing seems to be the most natural way for programmers to test their own code. In this small blog post, Henrik Warne shares some of the issues that people have when they switch from manual testing to a unit testing framework like JUnit.
Based on his long experience, Henrik Warne discusses five unit testing mistakes done when using unit testing tools:
1. Testing algorithms together with coordinators
2. Mocking too much
3. Not using asserts
4. Leaving print statements in the tests
5. Checking the log statements, not the result
Each of these mistakes are discussed in details, keeping in mind that the goal of automated unit testing is also to write modular code that can be tested in isolation and then testing the right thing.
Read the complete blog post on http://henrikwarne.com/2014/02/19/5-unit-testing-mistakes/