(TDD) allows developers working with frequent iterations to move forward with confidence. By writing tests first, to prescribe outcomes, then creating the functionality to achieve them, you can ensure successful builds behave in a predictable and reliable fashion. Thrill seekers who relish their “What the hell is going on?” moments may find TDD a little boring, but it’s a solid approach.
In application development, tests are usually written against functions and what those functions are expected to produce. For example, if I wanted to test that the
add() function from my add.js Node.js module worked correctly, I could use and the assertion library:
var expect = require('chai').expect; var ...