Ever since I started working as a developer for Clearent, I’ve been an adamant supporter of Test Driven Development (TDD). I adopted this development practice a very long time ago and have seen its benefits over and over again.
What is TDD?
Test Driven Development is a coding practice where a developer writes a failing unit test before writing the production code to make the test pass. Ideally, the unit test is built up slowly, adding a failing test condition that drives the next incremental feature in the code being created. (We achieve this incremental build-up by practicing a coding pattern called red-green-refactor.) The design of the code is “discovered” as the test is built-out, and the end product is a well-designed piece of functioning code. A by-product of this practice is a unit test that can be repeatedly run to ensure future changes don’t break the existing code base.