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.

Refactoring developer habits

1,218 views

Published on

We are creatures of habit, and our habits, good or not drive us to achieve results we aim for.

This presentation walks you through how 13 Good Habits of TDD programming have evolved into a refined list of such habits.

And when a group of talented craftsmen look at them again, take it to a newer level

Published in: Software
  • Be the first to like this

Refactoring developer habits

  1. 1. @theNeomatrix369 @pedromsantos Refactoring Developer Habits
  2. 2. @theNeomatrix369 @pedromsantos We are creatures of habit...
  3. 3. @theNeomatrix369 @pedromsantos ..our habits influence our actions greatly...
  4. 4. @theNeomatrix369 @pedromsantos Know and accept your good habits !
  5. 5. @theNeomatrix369 @pedromsantos Know and accept your bad habits !
  6. 6. @theNeomatrix369 @pedromsantos Developer habits is a very broad subject
  7. 7. @theNeomatrix369 @pedromsantos But we need to start somewhere
  8. 8. @theNeomatrix369 @pedromsantos The TDD life-cycle
  9. 9. @theNeomatrix369 @pedromsantos Let’s fit it into the TDD cycle Red-Green-Refactor cycle
  10. 10. @theNeomatrix369 @pedromsantos The TDD cycle ⇐ apply habits... Red phase ⇐ apply habits... Green phase ⇐ apply habits... Refactor phase ⇐ apply habits...
  11. 11. @theNeomatrix369 @pedromsantos Refactoring Developer Habits: birth of the #TDD #manifesto
  12. 12. @theNeomatrix369 @pedromsantos Original version
  13. 13. @theNeomatrix369 @pedromsantos Socrates UK 2013
  14. 14. @theNeomatrix369 @pedromsantos Refining: after discussion 1
  15. 15. @theNeomatrix369 @pedromsantos Refining: after discussion 2
  16. 16. @theNeomatrix369 @pedromsantos https://neomatrix369.wordpress.com/2013/09/27 Blog post - Socrates UK 2013
  17. 17. @theNeomatrix369 @pedromsantos Just before Socrates UK 2016, Pedro and Mani...
  18. 18. @theNeomatrix369 @pedromsantos Repeat the same exercise
  19. 19. @theNeomatrix369 @pedromsantos What should stay?
  20. 20. @theNeomatrix369 @pedromsantos What should be removed?
  21. 21. @theNeomatrix369 @pedromsantos What should be added?
  22. 22. @theNeomatrix369 @pedromsantos Should the flow be improved?
  23. 23. @theNeomatrix369 @pedromsantos Give more or less importance to any item?
  24. 24. @theNeomatrix369 @pedromsantos 15-20 minutes group discussion
  25. 25. @theNeomatrix369 @pedromsantos Results of the discussions
  26. 26. @theNeomatrix369 @pedromsantos Shared with the community Github: http://bit.ly/1tjLS7l
  27. 27. @theNeomatrix369 @pedromsantos Principles - tests should test one thing only - test one logical assertion - don't mix assertions of state and collaboration in the same test - modifications of production code should only break related test cases - each test should be self-contained, including data - ensure tests are independent of each other - don't refactor with a failing test - organise your unit test projects to reflect your production code - keep your tests and production code separate - do not use production data and code to test production code - if your tests are difficult to write or maintain, consider changing the design
  28. 28. @theNeomatrix369 @pedromsantos Red phase - create more specific tests to drive a more generic solution (Triangulate) - give your tests meaningful names (behaviour / goal-oriented) that reflect your production system - write the assertion first and work backwards - see the test fail for the right reason - ensure you have meaningful feedback from failing tests
  29. 29. @theNeomatrix369 @pedromsantos Green phase - write the simplest code to pass the test - write any code that makes you get to the refactor phase quicker - it is okay to write any code that you might improve at a later stage
  30. 30. @theNeomatrix369 @pedromsantos Refactor phase - refactor aggressively and constantly - treat tests as first class code - use the IDE to refactor quickly and safely - refactor production and test code independently (except changing public interfaces)
  31. 31. @theNeomatrix369 @pedromsantos Captured as a mind-map
  32. 32. @theNeomatrix369 @pedromsantos Does TDD lead to good design? Find out... http://codurance.com/2015/05/12/does-tdd-lead-to-good-design/
  33. 33. @theNeomatrix369 @pedromsantos Discuss with the community http://SoftwareCraftsmanship.slack.com channel: #tdd
  34. 34. @theNeomatrix369 @pedromsantos Big “thank you” to the first contributors http://bit.ly/235Ub3a
  35. 35. @theNeomatrix369 @pedromsantos Q&A Feedback
  36. 36. @theNeomatrix369 @pedromsantos Thanks to @jasongorman for sharing the original list
  37. 37. @theNeomatrix369 @pedromsantos Thank you!

×