TDD and JavaScript

Test-Driven Development using JavaScript

Created by @ajlopez

https://github.com/ajlopez/Talks/tree/master/TddJavaScript https://github.com/ajlopez/TddRocks/tree/master/JavaScript

Using reveal.js

TDD

Test-Driven Development

It's Not About Tests

Répétez avec moi!!!

IT'S NOT ABOUT TESTS!!!

IT'S NOT ABOUT TESTS!!!

IT'S NOT ABOUT TESTS!!!

It's About Development

  • It's a workflow
  • Push for simplicity
  • Tests are use examples
  • Red, Green, Refactor

The Three Laws of TDD

By @unclebobmartin

http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd

  • You are not allowed to write any production code unless it is to make a failing unit test pass.
  • You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures
  • You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

Aligned with

  • Baby steps
  • Make it works
  • Make it right
  • Make it fast

Without TDD

With TDD

Production Code With TDD

Production Code Without TDD

Pair Programming Bot ;-)

http://pairprogrammingbot.com/

JavaScript

The Language

  • Flexible
  • "Butter" Language ;-)
  • Module Pattern

Put the Money where the Mouth is

https://coderwall.com/ajlopez

Node.js

http://nodejs.org/

Baby Steps

Demo Time!

QUnit

http://qunitjs.com/

Things to Explore

The End

BY Angel 'Java' Lopez / www.ajlopez.com / @ajlopez