D.S

langrsoft.com

Langr Software Solutions » Reviewing TAD

Langr Software Solutions » Reviewing TAD — 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 Reviewing TAD March 26, 2009 By jlangr 0 Comment I’ve recently participated in a number of after-the-fact code reviews. Developers are supposed to be writing tests first, and are supposed to ask for help when they’re not sure how to do so. Here’s what it looks like: C = one unit of time spent coding T = one unit of time spent testing I = " " " " " in an inspection or review meeting R = " " " " " doing rework based on results of review x = " " " " " doing other work CCCC xxxx TTTTT xxx IIIII RRR II We’re obviously in TAD (test-after development) mode here. Pay attention to the right hand side, which roughly indicates: When could this code actually ship? Note that there are multiple Rs because many people are involved in the review meeting. Also note that there is a little more time spent on testing, and yet the coverage never ends up good enough (rarely more than 75%). And finally, note the rework and re-inspection that must take place. What the same model looks like with TDD: TCTCTCTC xxxx IIII xxx RR I So, a little less time building the right code in the first place, and also means a little less time in rework. It also means a little less time in review meetings, since the tests can help effectively describe whether or not the developer captured the requirements correctly. With pairing and TDD: TTCCTTCCTTCC xxxx xxx I’ve doubled up the Ts and Cs because there are now two people involved. I’m not even going to claim that pairing developers will produce a better solution faster, even though I’ve seen this to be the case. Note that this is now the shortest line by far. (It will even accommodate some amount of formal review–much smaller now because it’s already been actively reviewed at least once and preferably twice by the pairs building it–and still be shorter than the original process.) I’m also not accounting for “ramp-up” time wasted. The intervening xxx’s in the inspection-based flow means that minds have moved on to other things. When it comes time to review code, or rework it, developers must put their head back around something that they might have done days ago. Particularly without good tests, this can waste considerable time. I’m in an environment now where test-first is only beginning to take roots. Every day I see ample evidence why test-after is simply a bad, bad idea. 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