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.

Transformation Priority Premise @Softwerkskammer MUC

769 views

Published on

The slides of my "Transformation Priority Premise" Session at the Softwerkskammer Munich Meetup.

Published in: Software
  • Be the first to comment

Transformation Priority Premise @Softwerkskammer MUC

  1. 1. The Transformation Priority Premise Softwerkskammer Meetup Munich 11.02.2016 David Völkel
  2. 2. Agenda ● Pizza ● Theory ● Kata ● Another Beer
  3. 3. Problem Stuck with TDD Too much to implement in one test Image by Thor
  4. 4. Solution Take Baby Steps Image by Seattle Municipal Archives
  5. 5. What to choose next? Simple to Complex ● What is the most simple implementation? ● Uncle Bob‘s guideline: the „Transformation Priority Premise“
  6. 6. Test Driven Development red refactor green
  7. 7. Types of Code Testcode red refactor green „Transformation“ = Implementation Refactoring Design
  8. 8. Transformation Priorities ● ({}–>nil) no code at all -> code that returns nil ● (nil->constant) ● (constant->constant+) simple to a more complex constant ● (constant->scalar) replacing a constant with a variable ● (statement->statements) adding more unconditional statements ● (unconditional->if) splitting the execution path ● (scalar->array) ● (array->container) ● (statement->recursion) ● (if->while) ● (expression->function) ● (variable->assignment) replacing the value of a variable.
  9. 9. Strategy • When passing a test, prefer higher priority transformations • Choose as next test the one that can be implemented with higher priority transformations green refactor red
  10. 10. Strategy • When passing a test, prefer higher priority transformations • Choose as next test the one that can be implemented with higher priority transformations • Even during refactoring green refactor red
  11. 11. The Kata Transformation priorities: ● ({}–>nil) no code at all -> code that returns nil ● (nil->constant) ● (constant->constant+) simple to a more complex constant ● (constant->scalar) replacing a constant with a variable ● (statement->statements) adding more unconditional statements ● (unconditional->if) splitting the execution path ● (scalar->array) ● (array->container) ● (statement->recursion) ● (if->while) ● (expression->function) ● (variable->assignment) replacing the value of a variable. http://agilekatas.co.uk/katas/RomanNumerals-Kata
  12. 12. Share your experience!
  13. 13. The Kata Transformation priorities: ● ({}–>nil) no code at all -> code that returns nil ● (nil->constant) ● (constant->constant+) simple to a more complex constant ● (constant->scalar) replacing a constant with a variable ● (statement->statements) adding more unconditional statements ● (unconditional->if) splitting the execution path ● (scalar->array) ● (array->container) ● (statement->recursion) ● (if->while) ● (expression->function) ● (variable->assignment) replacing the value of a variable. http://agilekatas.co.uk/katas/RomanNumerals-Kata
  14. 14. Share your experience!
  15. 15. Benefits?
  16. 16. Benefits Easier and more effective TDD ● Complexity based guideline for choosing next test & implementation ● Reduces getting stuck with too big steps ● Less tests that are already green ● Less tests left out
  17. 17. Issues?
  18. 18. Issues ● Are there other transformations? (almost certainly) ● Are these the right transformations? (probably not) ● Are there better names for the transformations? (almost certainly) ● Is there really a priority? (I think so, but it might be more complicated than a simple ordinal sequence) ● If so, what is the principle behind that priority? (some notion of “complexity”) ● Can it be quantified? (I have no idea) ● Is the priority order presented in this blog correct? (not likely) ● The transformations as described are informal at best. Can they be formalized? (That’s the holy grail!) Raised by Uncle Bob
  19. 19. Retrospective
  20. 20. Special Thanks to Ivan Kusalic @ikusalic for your inspiration
  21. 21. Images THOR https://commons.wikimedia.org/wiki/File:Parkour_leap_of_faith.j pg?uselang=de Seattle Municipal Archives https://commons.wikimedia.org/wiki/File:Kids_at_Kubota_Garde n_2003.jpg
  22. 22. Lizenz Creative Commons Attribution-ShareAlike 3.0 https://creativecommons.org/licenses/by-sa/3.0/de/

×