Misko Hevery made a presentation at Google Tech Talks about unit testing. He tells us that “There is no secret to writing tests… … there are only secrets to writing testable code!”. He describes the different category of tests and shows the importance of unit testing. He describes how to avoid writing untestable code.
Testability-explorer is a tool which analyzes java byte-codes and computes how difficult it will be to write unit-test. It attempts to help you quantitatively determine how hard your code is to test and, where to focus to make it more testable