In order to get hooked by TDD it sometimes seems too much effort to setup things, but that should not be the barrier. Along came Google Spreadsheets and I had a no-setup environment, at least for doing katas and showing of the magic of being rewarded with a red box switching to green once I implemented the right thing. I will tell you the story of how I tried to make TDD as simple as possible and how I ended up with Google Spreadsheets and also how this inspired me to build tddbin.com for use at our JSCodeRetreats. I believe it’s the red-green cycle that got them hooked. I did it with students and also kids even a manager asked me “why does not everyone program like that?”.
41. undefined
AssertionError: 1 == 2
at repl:1:9
at REPLServer.self.eval (repl.js:110:21)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
at ReadStream.onkeypress (readline.js:99:10)
at ReadStream.EventEmitter.emit (events.js:98:17)
at emitKey (readline.js:1095:12)
> assert.equal(1,2)
$ node
> assert.equal(1,1)
42. assert.js:92
throw new assert.AssertionError({
^
AssertionError: 1 == 2
at Object.<anonymous> (/Users/cain/tmp/fail.js:1:81
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
> cat fail.js
require('assert').equal(1,2);
console.log('failed?');
> node fail.js
63. Photo by Great Beyond - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/26104563@N00 Created with Haiku Deck
lots of work done