The necessity of unit testing ceased to be the subject of discussion lately: the real-life practice has proved, that unit tests are essential for a stable product. But speaking about the necessity of writing unit tests, authors often forget to explain how to do this. At the same time, many developers don’t give pride of place to unit tests as a part of their job. The common approach is when developers simply create a test project using a basic testing framework only and then use this project to solve the same tasks again and again.
Every developer knows that the testable code can make life easier. There are a lot of books and articles written about unit-testing. Particular attention is paid to Test-driven development (TDD) as the best process for the development of hi-tech products. In my working routine, I face tons of problems with untestable code. It may happen even in those projects for which 100 percent test coverage is the main acceptance criteria.