Test Driven Development (TDD) is a technique of software development which asks the developer to write production code by writing small tests for that production code first. Writing tests first ensures excellent code coverage, easy refactoring of the production code; as it is backed by a lot of tests which tell immediately if something breaks and incremental and lean software development. TDD is the insurance policy that allows developers to write code and ship it to the customer with confidence.
One of the most important aspect of TDD is writing unit tests that are more readable and maintainable. Lot of people fail with TDD because when they add more unit tests to the code, they don’t put the effort to make them more readable and maintainable. I have seen cases where adding an extra dependency to a class would mean that the developers needs to modify 100 tests where they were creating an instance of that class. This is a [...]