O'Reilly logo

Inclusive Design Patterns by Smashing Magazine, Heydon Pickering

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test-Driven Markup

Test-driven development1 (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 Mocha2 and the Chai3 assertion library:

var expect = require('chai').expect;
var ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required