TDD Is My Shame

TDD Is My Shame

"I don't do as much Test-Driven Development as I should; it's my shame."

The more time I spend at recent development conferences, the more I see this sentiment echoed. Developers get the impression that they *should* do TDD, but they don't.

Sometimes they don't know how to do it effectively, so it ends up a mess.
Sometimes they don't know when they should do it, so it ends up being overapplied.
Sometimes they don't really know what it is, so they end up treating it in odd ways.

In this talk, you'll get answers for all of the above and more. You'll understand TDD better, you'll understand how to be more effective, and you'll learn to let go of that little voice that says you should do more.

1b5863cbb2d0009e78eaa85ea89fe2a6?s=128

garyfleming

March 04, 2020
Tweet

Transcript

  1. None
  2. None
  3. None
  4. I wasn't good at it right away, so I quit.

  5. None
  6. TDD IS MY SHAME @garyfleming

  7. PART 0: A JOURNEY INTO SHAME @garyfleming

  8. @garyfleming

  9. @garyfleming

  10. PUB / PAUL @garyfleming

  11. "I'm a little ashamed, but I don't TDD as much

    as I think I should." @garyfleming
  12. @garyfleming

  13. "Do you TDD?" @garyfleming

  14. SHAME @garyfleming

  15. WHAT IS SHAME? @garyfleming

  16. WHAT IS SHAME? > Self-awareness > Self-blame > Standards >

    Personal trait > Self-esteem > ... and more @garyfleming
  17. "LISTENING TO SHAME" BY BRENÉ BROWN @garyfleming

  18. "Shame, for women, is this web of unobtainable, conflicting, competing

    expectations about who we're supposed to be. And it's a straight-jacket. " - Brené Brown @garyfleming
  19. DON'T BE WEAK @garyfleming

  20. TDD AND SHAME @garyfleming

  21. YOU'RE GOOD ENOUGH @garyfleming

  22. None
  23. Easy

  24. PART 1. WHERE TO BEGIN WITH TDD? @garyfleming

  25. > Testing practice... Not really > Design Strategy... Maybe >

    Development practice... Probably @garyfleming
  26. @garyfleming

  27. NO ONE TRUE TDD @garyfleming

  28. ANCHOR TERMS @garyfleming

  29. UNIT TESTS @garyfleming

  30. UNIT TESTS > No Database > No network > No

    Filesystem > Must be Parallelisable > Can't have any weird environment set-up @garyfleming
  31. METZ SAYS > Thorough > Stable > Fast > Few

    @garyfleming
  32. TEST FIRST / TEST-DRIVEN DEVELOPMENT @garyfleming

  33. THE BASICS: RED - GREEN - REFACTOR @garyfleming

  34. THE BASICS: RED > Assertion Failure > Unexpected Exceptions >

    Missing code @garyfleming
  35. THE BASICS: GREEN @garyfleming

  36. THE BASICS: REFACTOR Change code without changing functionality. @garyfleming

  37. COMMON GRIPES: MUST. SEE. TEST. FAIL @garyfleming

  38. COMMON GRIPES: THE LOOP SHOULD BE MUCH SMALLER. @garyfleming

  39. COMMON GRIPES: PEOPLE THINK REFACTORING MEANS REWRITE @garyfleming

  40. COMMON GRIPES: PEOPLE FORGET TO REFACTOR @garyfleming

  41. COMMON GRIPES: RED - GREEN - REFACTOR ISN'T ENOUGH @garyfleming

  42. TWIST: SELECTION AND NAMING @garyfleming

  43. TWIST: SELECTION AND NAMING ☠ @garyfleming

  44. None
  45. Medium

  46. Medium

  47. PART 2: NOT NOW

  48. @garyfleming

  49. @garyfleming

  50. BUT, IT'S SLOOOOOOW... @garyfleming

  51. SATIR(ISH) @garyfleming

  52. DON'T DO IT. @garyfleming

  53. RON JEFFRIES DOESN'T TDD WHEN... > ...It's simple/throwaway > ...There

    isn't a decent tool at hand > ...The output is visual > ...He can't think how to test something @garyfleming
  54. RON JEFFRIES DOESN'T TDD WHEN... > ...It's simple/throwaway > ...There

    isn't a decent tool at hand > ...The output is visual > ...He can't think how to test something @garyfleming
  55. RON JEFFRIES DOESN'T TDD WHEN... > ...It's simple/throwaway > ...There

    isn't a decent tool at hand > ...The output is visual > ...He can't think how to test something @garyfleming
  56. RON JEFFRIES DOESN'T TDD WHEN... > ...It's simple/throwaway > ...There

    isn't a decent tool at hand > ...The output is visual > ...He can't think how to test something @garyfleming
  57. OTHER REASONS TO NOT... > ...You prefer larger methods, with

    less focus > ...You don't know how to keep the test loop small > ...You don't know how your system should behave @garyfleming
  58. None
  59. HARD

  60. PART 3: WHAT NOW?

  61. BECK'S FOUR ELEMENTS OF SIMPLE DESIGN > Passes The Tests

    > Reveals Intention > No Duplication > Fewest Elements @garyfleming
  62. WHAT DOES THIS ACTUALLY DO? > Passes The Tests >

    Reveals Intention > No Duplication > Fewest Elements @garyfleming
  63. Remove Duplication and Improve names in small cycles @garyfleming

  64. None
  65. GOOD NAMES > ...avoid unnecessary ambiguity > ...are just concise

    enough to convey the relavent info and no more > ...use the shared domain language as much as possible. @garyfleming
  66. TIME CHECK @garyfleming

  67. A NEAT TRICK @garyfleming

  68. None
  69. EXPERT

  70. EXPERT > Learning > Studying > Seeking New tools >

    Time > Deliberate practice
  71. THANK YOU @GARYFLEMING BIT.LY/TDD-SHAME @garyfleming