Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Test Driven Development: Blueprint, Toolbox, and Master Craft

979 views

Published on

Many say that the practice of test driven development (TDD) has the ability to transform software engineering. Let’s break it down from a skeptical pragmatist’s viewpoint. This presentation focuses on three key ideas; the blueprint, the toolbox, and the master craft. Let’s look at TDD as a blueprint for writing code and discuss the implications and benefit. Let’s go beyond the theoretical application of TDD and focus on the toolbox, with examples of what developers need to know to get going. Finally, TDD is a master craft of Agile engineering. To be effective with TDD, let’s look at the progression of skills needed to achieve the promised results of TDD and to maximize its value.

Stephen is the organizer of DC Alt.Net (http://bit.ly/ZRDxUj). He frequent speaker and trainer on many .NET topics, including automated testing, continuous integration, code analysis, and .NET best practices.Stephen is the author of the book "Pro .NET Best Practices" (http://amzn.to/v8TD8E).

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Test Driven Development: Blueprint, Toolbox, and Master Craft

  1. 1. Test Driven Development Blueprint, Toolbox, and Master Craft Stephen Ritchie April 1, 2013Stephen D. Ritchie – Managing Consultant – Excella Consulting, Inc., 2300 Wilson Blvd, Suite 630, Arlington, VA 22201 – 703.840.8600 – http://excella.com
  2. 2. Live Tweet, Slides and Examples• Twitter: @RuthlessHelp @Apress• Slides: http://www.slideshare.net/ruthlesshelp• Code Samples: http://github.com/ruthlesshelpStephen D. Ritchie 2
  3. 3. BlueprintStephen D. Ritchie 3
  4. 4. ToolboxStephen D. Ritchie 4
  5. 5. Master CraftStephen D. Ritchie 5
  6. 6. Motivation Why test software?Stephen D. Ritchie 6
  7. 7. MotivationStephen D. Ritchie 7
  8. 8. Blueprint 1 Red 2 Refactor Green 3Stephen D. Ritchie 8
  9. 9. Blueprint0. Think1. Write Test Code2. Write Production Code3. RefactorRepeat 12–40+ cycles/hrStephen D. Ritchie 9
  10. 10. Blueprint 0. ThinkStephen D. Ritchie 10
  11. 11. Blueprint 1. RedStephen D. Ritchie 11
  12. 12. Blueprint 2. GreenStephen D. Ritchie 12
  13. 13. Blueprint 3. RefactorStephen D. Ritchie 13
  14. 14. Blueprint RepeatStephen D. Ritchie 14
  15. 15. Automated Tests Make SureSoftware WorksAs You Intended
  16. 16. But wait …Stephen D. Ritchie 16
  17. 17. Temperature ConversionStephen D. Ritchie 17
  18. 18. Temperature ConversionSpecification By ExampleStart Where You StartDebug As You GoSafely RefactorEngaging (Fun?)Stephen D. Ritchie 18
  19. 19. TDD Katas• Bowling Score• Roman Numerals• Tennis Score• Conways Game of Life• Kata Sites: http://en.wikipedia.org/wiki/Kata_(programming)Stephen D. Ritchie 19
  20. 20. But wait …Stephen D. Ritchie 20
  21. 21. TDD: Quality, Visibility, Etc.• Focus on Requirements• Clear, Simple, & Testable• Documents Code’s Behavior• Suite of Regression Tests• Enables & Liberates Change• Visibility (KPI) – Number of Passing Tests – % Code Coverage• Problem PreventionStephen D. Ritchie 21
  22. 22. But wait …Stephen D. Ritchie 22
  23. 23. TDD: Agility http://amzn.to/172CrtTStephen D. Ritchie 23
  24. 24. TDD: Agility• Easier Debugging• Personal Process – Easy to Get Started – Easy to Keep Going• Detailed Design Do-Overs• What Was I Thinking? – What Was That Bozo Thinking?• Hey, Your API Doesn’t WorkStephen D. Ritchie 24
  25. 25. But wait …Stephen D. Ritchie 25
  26. 26. TDD: Legacy Code http://amzn.to/YMpZhlStephen D. Ritchie 26
  27. 27. TDD: Legacy Code• Assembly Coverage• Class Coverage• Method Coverage• Branch Coverage• Boundary Analysis• 100% Code CoverageStephen D. Ritchie 27
  28. 28. Toolbox TDD BooksStephen D. Ritchie 28
  29. 29. TDD: Big Picture http://amzn.to/10YXE5aStephen D. Ritchie 29
  30. 30. TDD: The Art http://amzn.to/XLOt4b Second Edition: http://bit.ly/XLOZz0Stephen D. Ritchie 30
  31. 31. Toolbox Testing Framework Run Tests Make AssertionsStephen D. Ritchie 31
  32. 32. MSTest - 32 -
  33. 33. MBUnit - 33 -
  34. 34. xUnit.net - 34 -
  35. 35. NUnithttp://www.nunit.org/ - 35 -
  36. 36. Toolbox Mocking Framework Isolation Interaction TestingStephen D. Ritchie 36
  37. 37. Rhino Mocks - 37 -
  38. 38. Moqhttp://bit.ly/ZHjQQ0 - 38 -
  39. 39. Unit TestingStephen D. Ritchie 39
  40. 40. The Master Craft Continuous Integration Automation MonitoringStephen D. Ritchie 40
  41. 41. CI ServersStephen D. Ritchie 41
  42. 42. CI in .NET http://amzn.to/10mXYItStephen D. Ritchie 42
  43. 43. The Master Craft Code Coverage Find Missing Tests MonitoringStephen D. Ritchie 43
  44. 44. Toolbox dotCover http://www.jetbrains.com/dotcover/Stephen D. Ritchie 44
  45. 45. Toolbox Open Cover http://nuget.org/packages/OpenCoverStephen D. Ritchie 45
  46. 46. The Master Craft http://www.ncover.com/Stephen D. Ritchie 46
  47. 47. The Master Craft Inversion of ControlDependency InjectionIoC ContainersMSDN Article: http://bit.ly/172KUxgStephen D. Ritchie 47
  48. 48. Toolbox Autofac http://code.google.com/p/autofac/Stephen D. Ritchie 48
  49. 49. The Master CraftStephen D. Ritchie 49
  50. 50. Of Course It’s Safe … After You
  51. 51. Shameless Self Promotion Time! • “Best Practices” Initiative • Tips and Tricks • Generate Ideas – Quantifying Value – Biases & Aversions – Tools & Technologies http://amzn.to/v8TD8E • Avoid Making the Same Mistakes Once.Stephen D. Ritchie 52
  52. 52. Shameless Self Promotion Time! • 40% off eBook at Apress.com http://www.apress.com/9781430240235 • Use promo code: FWUG40 • Offer expires 1-May- 2013Stephen D. Ritchie 53
  53. 53. Stephen’s Contact Info• Twitter: @RuthlessHelp• Email: stephen.ritchie@excella.com• Blog: http://ruthlesslyhelpful.net• LinkedIn: http://www.linkedin.com/in/sritchieStephen D. Ritchie 54

×