D.S

langrsoft.com

Langr Software Solutions » TDD Is Not Mindless

Langr Software Solutions » TDD Is Not Mindless — Main Menu — Home Consulting / Coaching Training - Information About Training - Student Quotes - Technical Training - Process Training Resources - Agile in a Flash blog - Articles - Jeff’s Wiselike Page (Q&A!) - Books Jeff’s Blog About Home Consulting / Coaching Training Information About Training Student Quotes Technical Training Process Training Resources Agile in a Flash blog Articles Jeff’s Wiselike Page (Q&A!) Books Jeff’s Blog About TDD Is Not Mindless August 07, 2012 By jlangr 0 Comment Claims that TDD is a mindless or tedious activity come only from those without a full understanding of the technique. You can’t succeed with TDD if you don’t think. We want you to not think about the steps in the technique itself–those become habitual after a short while–but instead think about the many things that are involved with growing software incrementally. You’ll need to answer many  questions at each step in the TDD cycle. Write a small test. What’s the smallest possible piece of behavior you can increment the system by ? Does the system already have that behavior? How can you concisely describe the behavior in a test name? Ensure the new test fails. If it doesn’t, why not? Does the behavior already exist? Should you add this as a new test? Did you forget to compile? Did you take too large a step in the prior test? Write the code you think makes the test pass. Are you writing no more code than needed to meet the current set of behaviors specified by the tests? Are you recognizing where the code you just wrote will need to be cleaned up? Are you following your team’s standards? Ensure all the tests pass. If not, did you code things incorrectly, or is your specification incorrect? Clean up the code changes you just made. What do you need to do in order to get your code to follow team standards? What do you know about design and clean code that you should apply here? Does your new code duplicate other code in the system that you should clean up, too? What other changes to system design should you make due to the impact of our code change? Ensure the tests all still pass. Do you trust that you have adequate unit test coverage? Should you run a slower set of tests to have the confidence to move on? What’s the next test? (The preceding list of questions comes from the forthcoming book Test-Driven Development in C++ by Jeff Langr, targeted to be published by PragProg in early 2013.) About the Author Social Share Leave a Reply Cancel reply Name * Email * Website Anti-Spam * Search this site Recent Posts The Compulsive Coder, Episode 7: Please AAA November 15, 2016 The Compulsive Coder, Episode 6: this Duplication is Killing Me October 19, 2016 The Consulting Legitimacy Cycle: 4+ years to 2 weeks September 13, 2016 The Compulsive Coder, Episode 5: Extract Method Flow September 7, 2016 The Compulsive Coder, Episode 4: You Create, It Assigns August 30, 2016 Contact Me Name Email Message Submit Langr Software Solutions, Inc. / Jeff Langr I've been there and seen just about everything: Professional developer for 33+ years Consultant helping customers learn and succeed since 2002 Author of five books on software development I can help you with: hands-on TDD mentoring / training / pairing getting your legacy code under control strengthening and growing a successful development process building a successful ATDD strategy with maintainable tests designing / running a distributed development team Want to hear more? Call 719-287-GEEK or use the Contact Me form to the left. Thank you! Jeff Langr Copyright © 2016 Langr Software Solutions. Call +1-719-287-GEEK with any questions or pricing inquiries, or to schedule consulting/training now! Atom