TDD with Google Spreadsheets #enterjs 2015

81
TDD with Google Spreadsheets @WolframKriesing, uxebu

Transcript of TDD with Google Spreadsheets #enterjs 2015

Page 1: TDD with Google Spreadsheets #enterjs 2015

TDD with Google Spreadsheets

@WolframKriesing, uxebu

Page 2: TDD with Google Spreadsheets #enterjs 2015
Page 3: TDD with Google Spreadsheets #enterjs 2015

http://www.ecma-international.org/ecma-262/6.0/

Page 4: TDD with Google Spreadsheets #enterjs 2015
Page 5: TDD with Google Spreadsheets #enterjs 2015
Page 6: TDD with Google Spreadsheets #enterjs 2015

{who: „Wolfram Kriesing“,what: „uxebu Co-Founder“,since: „2008“,does: „web apps since 1999“,

url: „http://uxebu.com“,twitter: „@WolframKriesing“

}

Page 7: TDD with Google Spreadsheets #enterjs 2015
Page 8: TDD with Google Spreadsheets #enterjs 2015
Page 9: TDD with Google Spreadsheets #enterjs 2015

{what: „ES6 learning by doing“,

when: „new kata every day“,

url: „http://ES6katas.org“,twitter: „@es6katas“

}

Page 10: TDD with Google Spreadsheets #enterjs 2015
Page 11: TDD with Google Spreadsheets #enterjs 2015

{what: „ready to use TDD env“,

why: „practice, practice, practice“,

url: „http://TDDbin.com“,twitter: „@tddbin“

}

Page 12: TDD with Google Spreadsheets #enterjs 2015
Page 13: TDD with Google Spreadsheets #enterjs 2015

{what: „TDD, pairing, clean code“,

when: „every 3 months“,next: „5th September 2015“,

url: „http://jsCodeRetreat.com“,twitter: „@jsCodeRetreat“

}

Page 14: TDD with Google Spreadsheets #enterjs 2015

TDD?

Page 15: TDD with Google Spreadsheets #enterjs 2015
Page 16: TDD with Google Spreadsheets #enterjs 2015
Page 17: TDD with Google Spreadsheets #enterjs 2015
Page 18: TDD with Google Spreadsheets #enterjs 2015
Page 19: TDD with Google Spreadsheets #enterjs 2015

IHADTO

Page 20: TDD with Google Spreadsheets #enterjs 2015

ITOX!

e x p l a i n

Page 21: TDD with Google Spreadsheets #enterjs 2015

ITOX!TO AKID

Page 22: TDD with Google Spreadsheets #enterjs 2015
Page 23: TDD with Google Spreadsheets #enterjs 2015

SIM PLI

CITY

Page 24: TDD with Google Spreadsheets #enterjs 2015
Page 25: TDD with Google Spreadsheets #enterjs 2015

…img baby steps on stairs…

Photo by t0msk - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/11904001@N00

baby steps

Page 26: TDD with Google Spreadsheets #enterjs 2015

http://cache.lego.com/bigdownloads/buildinginstructions/6098577.pdf

Page 27: TDD with Google Spreadsheets #enterjs 2015
Page 28: TDD with Google Spreadsheets #enterjs 2015

https://www.facebook.com/IFeakingLoveScience

Page 29: TDD with Google Spreadsheets #enterjs 2015

GOALSPROXIMAL

http://www.entrepreneur.com/article/245767

but scientists prefer the much stuffier term

Page 30: TDD with Google Spreadsheets #enterjs 2015

http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf

Page 31: TDD with Google Spreadsheets #enterjs 2015

http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf

Page 32: TDD with Google Spreadsheets #enterjs 2015

http://www.uky.edu/~eushe2/Bandura/Bandura1981JPSP.pdf

Page 33: TDD with Google Spreadsheets #enterjs 2015

USCOF

Page 34: TDD with Google Spreadsheets #enterjs 2015

FUSCOon

what?

Page 35: TDD with Google Spreadsheets #enterjs 2015

TESTF R A M EWORKS?

Page 36: TDD with Google Spreadsheets #enterjs 2015

expect().toBe()

expect().to.be()

assert.equal()

Page 37: TDD with Google Spreadsheets #enterjs 2015

Jasmine image…

Page 38: TDD with Google Spreadsheets #enterjs 2015

mocha image…

Page 39: TDD with Google Spreadsheets #enterjs 2015

many others, doh, quint, jsunit, tap, …

Page 40: TDD with Google Spreadsheets #enterjs 2015

TEST

u n d e r d a h o o d

FRA

MEWORK

Page 41: TDD with Google Spreadsheets #enterjs 2015

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)

Page 42: TDD with Google Spreadsheets #enterjs 2015

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) at node.js:902:3

> cat fail.jsrequire('assert').equal(1,2);console.log('failed?');

> node fail.js

Page 43: TDD with Google Spreadsheets #enterjs 2015

KIND OF TEST

Page 44: TDD with Google Spreadsheets #enterjs 2015
Page 45: TDD with Google Spreadsheets #enterjs 2015

STYLE

Page 46: TDD with Google Spreadsheets #enterjs 2015

https://www.goodreads.com/quotes/tag/learning

Page 47: TDD with Google Spreadsheets #enterjs 2015
Page 48: TDD with Google Spreadsheets #enterjs 2015

reduce it to the core

=

focus

Page 49: TDD with Google Spreadsheets #enterjs 2015

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.

Page 50: TDD with Google Spreadsheets #enterjs 2015

THE TASK

Page 51: TDD with Google Spreadsheets #enterjs 2015

https://github.com/search?utf8=✓&q=roman+numerals

Page 52: TDD with Google Spreadsheets #enterjs 2015

https://github.com/search?l=JavaScript&q=roman+numerals&type=Repositories&utf8=✓

Page 53: TDD with Google Spreadsheets #enterjs 2015

https://github.com/marcusholmgren/RomanNumerals/blob/master/spec/romanConverterSpec.coffee

Page 54: TDD with Google Spreadsheets #enterjs 2015

https://github.com/Ginkko/roman/blob/master/spec/specs.js

Page 55: TDD with Google Spreadsheets #enterjs 2015

https://github.com/Bryukh-Checkio-Tasks/checkio-task-roman-numerals/blob/master/verification/tests.py

Page 56: TDD with Google Spreadsheets #enterjs 2015

https://github.com/davidbaldwin/roman/blob/master/src/_roman_test.js

Page 57: TDD with Google Spreadsheets #enterjs 2015

Noise

polluting our intent

Page 58: TDD with Google Spreadsheets #enterjs 2015

noise pollution the programming language

Page 59: TDD with Google Spreadsheets #enterjs 2015

Let’s remove it!

Page 60: TDD with Google Spreadsheets #enterjs 2015

Language noise++

Page 61: TDD with Google Spreadsheets #enterjs 2015

Language noise++

Page 62: TDD with Google Spreadsheets #enterjs 2015

FRA

MEWORK

Page 63: TDD with Google Spreadsheets #enterjs 2015

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

Page 64: TDD with Google Spreadsheets #enterjs 2015

?

Page 65: TDD with Google Spreadsheets #enterjs 2015

good naming!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Page 66: TDD with Google Spreadsheets #enterjs 2015
Page 67: TDD with Google Spreadsheets #enterjs 2015

Completely Missing - #1 result close to test

Page 68: TDD with Google Spreadsheets #enterjs 2015

Completely Missing - #2 ugly stack traces

Page 69: TDD with Google Spreadsheets #enterjs 2015

Completely Missing - #3 context switch needed

Photo by @Doug88888 - Creative Commons Attribution-NonCommercial-ShareAlike License https://www.flickr.com/photos/29468339@N02

Page 70: TDD with Google Spreadsheets #enterjs 2015

Completely Missing

• result beside test

• ugly stack traces

• context switch necessary

Page 71: TDD with Google Spreadsheets #enterjs 2015

Noise

covers

and

blurs

Page 72: TDD with Google Spreadsheets #enterjs 2015

N O W

LET’S CODE

Page 73: TDD with Google Spreadsheets #enterjs 2015

EX AMP LES

Page 74: TDD with Google Spreadsheets #enterjs 2015
Page 75: TDD with Google Spreadsheets #enterjs 2015
Page 76: TDD with Google Spreadsheets #enterjs 2015
Page 77: TDD with Google Spreadsheets #enterjs 2015
Page 78: TDD with Google Spreadsheets #enterjs 2015
Page 79: TDD with Google Spreadsheets #enterjs 2015
Page 80: TDD with Google Spreadsheets #enterjs 2015

Take aways

• think less complex

• fast feedback rocks

• baby steps

make a test fit in a cell

write less code

Page 81: TDD with Google Spreadsheets #enterjs 2015

uxebu.com/workshop

@WolframKriesing