why not do tdd?

46
Why NOT Do TDD? Bob Allen Code Craftsman meeting Sept 3

Upload: kata

Post on 24-Feb-2016

26 views

Category:

Documents


0 download

DESCRIPTION

Why NOT Do TDD?. Bob Allen Code Craftsman meeting Sept 3. Why NOT Do TDD? Mobile apps. "We can't do TDD because … … we work on Android apps": . Why NOT Do TDD? Mobile apps. "We can't do TDD because … … we work on Android apps" : … we work on IOS apps (Objective-C) ": . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Why  NOT  Do TDD?

Why NOT Do TDD?

Bob Allen Code Craftsman meeting Sept 3

Page 2: Why  NOT  Do TDD?

Why NOT Do TDD?Mobile apps

"We can't do TDD because …• … we work on Android apps":

Page 3: Why  NOT  Do TDD?

Why NOT Do TDD?Mobile apps

"We can't do TDD because …• … we work on Android apps":• … we work on IOS apps (Objective-C) ":

Page 4: Why  NOT  Do TDD?

Why NOT Do TDD?It’s a new language

"We can't do TDD because …• … we code in Scala":

Page 5: Why  NOT  Do TDD?

Why NOT Do TDD?It’s a new language

"We can't do TDD because …• … we code in Scala":• … we code in Erlang:

Page 6: Why  NOT  Do TDD?

Why NOT Do TDD?It’s a new language

"We can't do TDD because …• … we code in Scala":• … we code in Erlang:• … we code Clojure":

Page 7: Why  NOT  Do TDD?

Why NOT Do TDD?It’s a new language

"We can't do TDD because …• … we code in Scala":• … we code in Erlang:• … we code Clojure":• … we code in < some functional language >":

Page 8: Why  NOT  Do TDD?

Why NOT Do TDD?We don’t know how

"We can't do TDD because …• … we work in JavaScript":

Page 9: Why  NOT  Do TDD?

Why NOT Do TDD?We don’t know how

"We can't do TDD because …• … we work in JavaScript": • …we work on { Angular | NodeJS | Backbone |

…}":

Page 10: Why  NOT  Do TDD?

Why NOT Do TDD?It’s too old of a language

"We can't do TDD because …• …we work in COBOL":

Page 11: Why  NOT  Do TDD?

Why NOT Do TDD?It’s too old of a language

"We can't do TDD because …• …we work in COBOL": • … we work in RPG":

Page 12: Why  NOT  Do TDD?

Why NOT Do TDD?It’s too old of a language

"We can't do TDD because …• …we work in COBOL": • … we work in RPG": • … we work in .NET/C#":

Page 13: Why  NOT  Do TDD?

Why NOT Do TDD?It’s too old of a language

"We can't do TDD because …• …we work in COBOL": • … we work in RPG": • … we work in .NET/C#":• … we work in assembler":

Page 14: Why  NOT  Do TDD?

Why NOT Do TDD?It’s takes too long to run

"We can't do TDD because …• … our tests take forever":

Page 15: Why  NOT  Do TDD?

Why NOT Do TDD?It’s takes too long to run

"We can't do TDD because …• … our tests take forever": • … the unit testing framework is too slow”:

Page 16: Why  NOT  Do TDD?

Why NOT Do TDD?It’s takes too long to run

"We can't do TDD because …• … our tests take forever": • … the unit testing framework is too slow”:• … what’s a mock and why are static methods

bad?”:

Page 17: Why  NOT  Do TDD?

Why NOT Do TDD?TDD is only for trivial cases

• Trivial apps like Facebook, Google, and Amazon. These guys any many more use TDD.

Page 18: Why  NOT  Do TDD?

Why NOT Do TDD?TDD is only for trivial cases

• Trival apps like Facebook, Google, and Amazon. These guys and many more use TDD.

• Major portions of Eclipse and Visual Studio were developed using TDD. Probably just the trivial parts though.

Page 19: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting

Page 20: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting• Reporting

Page 21: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting• Reporting• Tracking

Page 22: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting• Reporting• Tracking• Charting

Page 23: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting• Reporting• Tracking• Charting• Investigating

Page 24: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Detecting• Reporting• Tracking• Charting• Investigating• Solving (days or weeks after creating the bug)

Page 25: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Doing all that stuff, • And compare it to the time required to

prevent it in the first place.

Page 26: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Doing all that stuff, • And compare it to the time required to

prevent the bug in the first place.

Page 27: Why  NOT  Do TDD?

Why NOT Do TDD?TDD slows down the development process

Add up all the time you spend …• Doing all that stuff, • And compare it to the time required to

prevent the bug in the first place.• Then think about having single-digit bug

counts (zero is a single digit).

Page 28: Why  NOT  Do TDD?

Why NOT Do TDD?TDD Means Not Doing Any Design Thinking Up Front

Bull …• First: Sketches, CRC cards, and even UML are

all present and recommended in Beck’s book Extreme Programming Explained.

Page 29: Why  NOT  Do TDD?

Why NOT Do TDD?TDD Means Not Doing Any Design Thinking Up Front

Bull …• First: Sketches, CRC cards, and even UML are

all present and recommended in Beck’s book Extreme Programming Explained.

• Second: TDD is design. Emergent design that allows for and pretty much demands that you apply what you learn along the way.

Page 30: Why  NOT  Do TDD?

Why NOT Do TDD?TDD Doesn’t Catch ALL The Bugs

Yep …• If you find a process that does, please use it.

Page 31: Why  NOT  Do TDD?

Why NOT Do TDD?TDD Doesn’t Catch ALL The Bugs

Yep …• If you find a process that does, please use it.• …and tell us about it.

Page 32: Why  NOT  Do TDD?

Why NOT Do TDD?What Else?

You’ve probably been given reasons (or have your own) for why/when NOT to use TDD.

Let’s hear them.

Then we’ll do some coding…

Page 33: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #1

Point your browsers at Cyber-Dojo.com (20 minutes of playtime):

Page 34: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #1

Point your browsers at Cyber-Dojo.com (20 minutes of playtime):• - Self-organize into pairs or triplets (as you see fit).• Hit start and note your assigned animal.• Take out your smart phone or anything else you can use as a timer.• Start a 2-minute timer and begin. • IF you get to GREEN before the timer expires, then go ahead and

refactor if need be. Then restart your timer, and go back a step.• IF you FAIL to get to green before the timer expires, revert to your

prior green traffic light (see the “Click to revert” arrow in the lower left) and go back two steps (start timer).

Page 35: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #1

STOP!20 minutes have gone by.

Time for a RETRO

Page 36: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #1

RETROWhat was THAT all about? (can you guess?)

Page 37: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #1

RETROWhat was THAT all about? (can you guess?)

THAT was “Taking Baby Steps” (thank you Adrian Bolboaca). The point is emphasize the importance of taking very small steps to prevent getting lost in the weeds, and being willing to throw away what you’ve got and start again when you’re down the rabbit hole.

Page 38: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

Want to do another (45 minutes)?

Page 39: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

Want to do another (45 minutes)?• Go back to Cyber-Dojo.com. Pick a different problem this time;

either one you’re familiar with, or a new problem, it doesn’t matter.

• Self-organize into pairs or triplets (as you see fit).• This time, I’ll start a 10-minute timer, but you can iterate as many

times as you wish within that 10 minutes. WRITE GOOD CODE.• At the end of ten minutes, I’ll let you know what I want you to do

next.

Page 40: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

Starting the second 10 minutes: Person on the left shift over to next pair on their left.

• move one pair over (just one person in each pair).

• Start second ten minute iteration.• Veterans (the pair member that stayed

behind): you’re the newbie’s guide

Page 41: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

Starting the third minutes: Person on the right shifts right.

• move one pair to your right (just one person in each pair).

• Start third ten minute iteration.• Veterans (the pair member that stayed

behind): you’re the newbie’s guide

Page 42: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

Starting the fourth 10 minutes: Both pair members move this time.

• Person the left, move over to the next pair to your left.

• Person on the right, move one pair over to your right.• Start fourth ten minute iteration.• There are no veterans at this point.

WAAHHHAAAHAA!

Page 43: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

STOP!40 minutes have gone by.

Time for a RETRO

Page 44: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

RETROWhat was THAT all about? (can you guess?)

Page 45: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

RETROWhat was THAT all about? (can you guess?)

THAT was “Crazy Boston Pairing” (thank you Zack Shaw). It’s about learning to appreciate what the next person that looks at your code is going to encounter and writing expressive code to help-out that next person. You may be that next person, but maybe not.

Page 46: Why  NOT  Do TDD?

Why NOT Do TDD?Coding Playtime #2

FINI!

Please visit http://codecraftmansaturdays.blogspot.com

See you in 2 weeks??