Originally posted on: GWB in February 2014.
I recently was asked by a co-worker to watch Ian Cooper talk about TDD to give my take on Mr. Cooper’s presentation on TDD. Here’s what I sent back and decided to share it with all of you as well.
He’s got a lot of experience and laid out things are often stated as things against TDD. He even mentions SpecFlow and problems he had with that. This turns out to validate some of my ideas on BDD. Interesting talk about refactoring too (write code quick, then refactor and write clean code).
I’d suggest that people watch this. It expands on what I’ve been presenting (at work). I learned a lot from it.
TDD book by Kent Beck.
What is a unit test? minute 23
‘runs in isolation’ fast could be multiple classes to test the behavior The simplest thing:
Get it to pass as quickly as you can. Only write the code you need to get the test to pass
Design doesn’t matter right away, then refactor (I wonder about that…)
Refactoring is when we produce clean code (min 34)
4 new classes, none have new tests at this point Can’t do refactoring when testing implementation details (so then, my tests I’ve written that ShouldHaveBeenCalled might not always be the way to test… Jason was saying this yesterday)
Integration tests needed because we’ve lost confidence in our tests? (min 40)
“Dependency is the key problem in software development at all scales” Kent Beck
Eliminate dependency between tests and code:
tests should depend on contracts or public interfaces don’t bake implementation into tests! test behaviors, not implementations min 47
Design Patterns of TDD from Kent Beck
Ice Cream cone anti-pattern
min 54 domain model diagram, walk through with use cases
I skipped some here..
“Object Mother” (1:23) - coded mock object, becomes bloated
Test Builder pattern
fluent, with overrides Summary at 1:26
test the port (BAL?) not the adapter (DAL)
Please consider using Brave and adding me to your payment ledger. Then you won't have to see ads!