Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TDD with Google Spreadsheets #enterjs 2015

848 views

Published on

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?”.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

TDD with Google Spreadsheets #enterjs 2015

  1. 1. TDD with Google Spreadsheets @WolframKriesing, uxebu
  2. 2. http://www.ecma-international.org/ecma-262/6.0/
  3. 3. { who: „Wolfram Kriesing“, what: „uxebu Co-Founder“, since: „2008“, does: „web apps since 1999“, url: „http://uxebu.com“, twitter: „@WolframKriesing“ }
  4. 4. { what: „ES6 learning by doing“, when: „new kata every day“, url: „http://ES6katas.org“, twitter: „@es6katas“ }
  5. 5. { what: „ready to use TDD env“, why: „practice, practice, practice“, url: „http://TDDbin.com“, twitter: „@tddbin“ }
  6. 6. { what: „TDD, pairing, clean code“, when: „every 3 months“, next: „5th September 2015“, url: „http://jsCodeRetreat.com“, twitter: „@jsCodeRetreat“ }
  7. 7. TDD?
  8. 8. IHAD TO
  9. 9. I TO X!e x p l a i n
  10. 10. I TO X!TO A KID
  11. 11. SIM PLI CITY
  12. 12. …img baby steps on stairs… Photo by t0msk - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/11904001@N00 baby steps
  13. 13. http://cache.lego.com/bigdownloads/buildinginstructions/6098577.pdf
  14. 14. https://www.facebook.com/IFeakingLoveScience
  15. 15. GOALS PROXIMAL http://www.entrepreneur.com/article/245767 but scientists prefer the much stuffier term
  16. 16. http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf
  17. 17. http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf
  18. 18. http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf
  19. 19. US COF
  20. 20. F US COon what?
  21. 21. TESTF R A M E WORKS?
  22. 22. expect().toBe() expect().to.be() assert.equal()
  23. 23. Jasmine image…
  24. 24. mocha image…
  25. 25. many others, doh, quint, jsunit, tap, …
  26. 26. TEST u n d e r d a h o o d FRA MEWORK
  27. 27. 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)
  28. 28. 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
  29. 29. KIND OF TEST
  30. 30. STYLE
  31. 31. https://www.goodreads.com/quotes/tag/learning
  32. 32. reduce it to the core = focus
  33. 33. I fear not the man who has practiced 10.000 kicks once but I fear the man who has practiced one kick 10.000 times.
  34. 34. THE TASK
  35. 35. https://github.com/search?utf8=✓&q=roman+numerals
  36. 36. https://github.com/search?l=JavaScript&q=roman+numerals&type=Repositories&utf8=✓
  37. 37. https://github.com/marcusholmgren/RomanNumerals/blob/master/spec/romanConverterSpec.coffee
  38. 38. https://github.com/Ginkko/roman/blob/master/spec/specs.js
  39. 39. https://github.com/Bryukh-Checkio-Tasks/checkio-task-roman-numerals/blob/master/verification/tests.py
  40. 40. https://github.com/davidbaldwin/roman/blob/master/src/_roman_test.js
  41. 41. Noise polluting our intent
  42. 42. noise pollution the programming language
  43. 43. Let’s remove it!
  44. 44. Language noise++
  45. 45. Language noise++
  46. 46. FRA MEWORK
  47. 47. 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
  48. 48. ?
  49. 49. good naming!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  50. 50. Completely Missing - #1 result close to test
  51. 51. Completely Missing - #2 ugly stack traces
  52. 52. Completely Missing - #3 context switch needed Photo by @Doug88888 - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/29468339@N02
  53. 53. Completely Missing • result beside test • ugly stack traces • context switch necessary
  54. 54. Noise covers and blurs
  55. 55. N O W LET’S CODE
  56. 56. EX AMP LES
  57. 57. Take aways • think less complex • fast feedback rocks • baby steps make a test fit in a cell write less code
  58. 58. uxebu.com/workshop @WolframKriesing

×