460 likes | 611 Views
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) ": .
E N D
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) ":
Why NOT Do TDD?It’s a new language "We can't do TDD because … • … we code in Scala":
Why NOT Do TDD?It’s a new language "We can't do TDD because … • … we code in Scala": • … we code in Erlang:
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":
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 >":
Why NOT Do TDD?We don’t know how "We can't do TDD because … • … we work in JavaScript":
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 | …}":
Why NOT Do TDD?It’s too old of a language "We can't do TDD because … • …we work in COBOL":
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":
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#":
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":
Why NOT Do TDD?It’s takes too long to run "We can't do TDD because … • … our tests take forever":
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”:
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?”:
Why NOT Do TDD?TDD is only for trivial cases • Trivial apps like Facebook, Google, and Amazon. These guys any many more use 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.
Why NOT Do TDD?TDD slows down the development process Add up all the time you spend … • Detecting
Why NOT Do TDD?TDD slows down the development process Add up all the time you spend … • Detecting • Reporting
Why NOT Do TDD?TDD slows down the development process Add up all the time you spend … • Detecting • Reporting • Tracking
Why NOT Do TDD?TDD slows down the development process Add up all the time you spend … • Detecting • Reporting • Tracking • Charting
Why NOT Do TDD?TDD slows down the development process Add up all the time you spend … • Detecting • Reporting • Tracking • Charting • Investigating
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)
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.
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.
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).
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.
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.
Why NOT Do TDD?TDD Doesn’t Catch ALL The Bugs Yep … • If you find a process that does, please use it.
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.
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…
Why NOT Do TDD?Coding Playtime #1 Point your browsers at Cyber-Dojo.com (20 minutes of playtime):
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).
Why NOT Do TDD?Coding Playtime #1 STOP! 20 minutes have gone by. Time for a RETRO
Why NOT Do TDD?Coding Playtime #1 RETROWhat was THAT all about? (can you guess?)
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.
Why NOT Do TDD?Coding Playtime #2 Want to do another (45 minutes)?
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.
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
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
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!
Why NOT Do TDD?Coding Playtime #2 STOP! 40 minutes have gone by. Time for a RETRO
Why NOT Do TDD?Coding Playtime #2 RETROWhat was THAT all about? (can you guess?)
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.
Why NOT Do TDD?Coding Playtime #2 FINI! Please visit http://codecraftmansaturdays.blogspot.com See you in 2 weeks??