TDD, Where Did It All Go Wrong - Ian Cooper https://www.youtube.com/watch?v=EZ05e7EMOLM

Ian Cooper - TDD, Where Did It All Go Wrong https://www.youtube.com/watch?v=EZ05e7EMOLM

Trigger for writing test != new method != new class = requirement ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.3.png

test api ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.10.png

System Under Test (SUT) != class Unit test -> exports of module ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.12.png

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.15.png

refactoring = separate implementation detail from things you do need to test

extra ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.4.png

“The word ’test’ in TDD confuses people about how to do TDD, when I change it to Behavior, it tends to be better understood” -- Dan North

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.14.png

todo: re-read ‘TDD by example’

design clean api first, then realistic ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.9.png

test is first consumer of your code

unit of isolation = test, not sut ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.8.png

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.6.png

===

RED-GREEN-REFACTOR

  1. write test that fails without implementation
  2. make test pass asap, sinful, ducttape line by line not nice classes, no patterns speed > design
  3. make good code

""" You can’t do 2 things at once easily - understand the solution to the problem - engineer the code right You will either - over-engineer - analysis-paralysis """

===

CLEAN CODE WHEN

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.png

refactoring don’t write tests private/internal visibility

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.1.png

only in the refactoring step now I know I need it ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.2.png Book: Refactoring to Patterns - Joshua Kerievsky

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.13.png

===

HEXAGONAL ARCHITECTURE PORTS AND ADAPTERS

===

GEARS throw away helping tests with implementation details when implemented

===

ACCEPTANCE TDD Don’t do it - customers are not interested - they’re expensive Maybe you need it, because programmer tests don’t focus on the gist of the system.

===

MOCKS ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.11.png

./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.5.png

===

SUMMARY ./resources/video-tdd-where-did-it-all-go-wrong-ian-cooper.resources/screenshot.7.png

check out: https://martinfowler.com/articles/is-tdd-dead/