Wednesday, November 19, 2014

Pure TDD: A JavaScript Example

The other day I took some time to practice TDD, in JavaScript. I chose a problem at random from cyber-dojo and worked my way through, as by-the-book (following Red->Green->Refactor) as I could.

Not only did I finish this exercise, but I committed each step of the process to github.

So, if you're interested in reading through an example as-pure-as-I-can-at-the-moment-TDD-session, start with this commit (I'd recommend a tool like `gitg` so that you can step through the commits easily).

Some Notes

  • The problem took me 12 Red->Green->Refactor cycles where I kept divided up a lot of the refactors into smaller steps (to keep the commits sensible).
  • At some points the algorithm got kind of bloated, but overall patterns did emerge and were easy to generalize.

1 comment:

  1. emperor casino
    king casino 인카지노 - Slots · About Slots · Online Slots · Casino Games. Casino · Bonuses 샌즈카지노 · Free Spins · Casino Games. Casino · Promotions. 제왕카지노 No Deposit Bonuses.

    ReplyDelete