Video: TDD, Where Did It All Go Wrong - Ian Cooper

April 5th, 2019

TDD, Where Did It All Go Wrong - Ian Cooper

https://www.youtube.com/watch?v=EZ05e7EMOLM

 

 

[ ] Book: Refactoring - Martin Fowler

[ ] Book: Refactoring to Patterns - Joshua Kerievsky

[x] Book: Test Driven Development: By Example - Kent Beck

[x] Article: Is TDD Dead? - Martin Fowler

 

 

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

no description for image available

 

 

 

 

 

test api

no description for image available

 

 

 

 

 

System Under Test (SUT) != class

Unit test -> exports of module

no description for image available

 

 

 

 

 

no description for image available

 

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

 

 

extra

no description for image available

 

 

 

 

 

"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

 

 

 

 

no description for image available

 

 

 

todo: re-read 'TDD by example'

 

 

design clean api first, then realistic

no description for image available

 

test is first consumer of your code

 

 

unit of isolation = test, not sut

no description for image available

 

 

 

 

 

no description for image available

 

 

 

===

 

 

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

 

 

no description for image available

 

 

 

refactoring

don't write tests

private/internal visibility

 

 

 

 

no description for image available

 

 

 

 

 

only in the refactoring step

now I know I need it

no description for image available

Book: Refactoring to Patterns - Joshua Kerievsky

 

 

 

 

no description for image available

 

 

 

 

 

===

 

 

 

 

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

no description for image available

 

 

 

no description for image available

 

 

 

 

 

===

 

 

SUMMARY

no description for image available

 

 

 

 

 

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