$30 off During Our Annual Pro Sale. View Details »

TCR workshop

TCR workshop

Slides of the workshop co-facilitated in Stockholm https://www.meetup.com/es-ES/Stockholm-Software-Craftsmanship/events/259388924

The goal was to get to know the TCR workflow, try it in a couple of katas and learn something new, whatever it is :-)

Isidro López

March 12, 2019
Tweet

More Decks by Isidro López

Other Decks in Programming

Transcript

  1. TCR workshop
    "test && commit || revert"
    Stockholm, 12th March 2019

    View Slide

  2. Ego slide
    Software professional (code, product, people...)
    @islomar
    [email protected]
    Something
    @joebew42
    [email protected]

    View Slide

  3. Agenda
    1. Review of TDD
    2. New workflow: TCR (test && commit || revert)
    3. Presentation of the kata: Fibonacci
    4. First round to try… go!!
    5. Second round to try… go!!
    6. Opinions and feedback
    7. Some downsides of TCR
    8. Final recap
    9. Interesting links
    10. Dinner and networking!

    View Slide

  4. Disclaimer
    We have not tried TCR with Production code
    We are learners
    We are here to practice and learn the new workflow

    View Slide

  5. Review TDD
    http://luizricardo.org/wordpress/wp-content/upload-files/2014/05/tdd_flow.gif

    View Slide

  6. A new workflow: TCR
    Popularised by Kent Beck after post in September 2018:
    https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864
    Experiment in Code Camp by Oddmund Strømmer, Lars Barlindhaug and Ole
    Johannessen
    Basic idea: test && commit || revert

    View Slide

  7. TCR: an oversimplified diagram
    Run your
    tests…result?
    commit
    revert
    write your code
    GREEN
    RED

    View Slide

  8. https://rachelcarmena.github.io/img/cards/posts/test-driven-programming-workflows/workflows-with-an-idea-for-TCR.png
    TCR complete diagram

    View Slide

  9. Repository with TCR scripts
    https://github.com/islomar/tcr-workshop

    View Slide

  10. Kata: Fibonacci sequence

    View Slide

  11. Reminders for the set up
    ● You need Git installed
    ● Disable the auto-save mode
    ● Be sure your files get refreshed in your IDE (or you can force it easily)
    ● If you’re not using Java, Ruby or Python, there is a generic template

    View Slide

  12. First pomodoro… go!
    https://entregurus.com/the-pomodoro-technique/

    View Slide

  13. Bonus track
    ● Have you tried recursion? And memoization?
    https://medium.com/@nothingisfunny/memoization-improving-recursive-
    solution-for-fibonacci-sequence-problem-c02dab7a74e5
    ● Try another kata, e.g. substring kata:

    View Slide

  14. Second pomodoro… go!
    https://entregurus.com/the-pomodoro-technique/

    View Slide

  15. Opinions and feedback
    ● Did you learn anything new?
    ● Which was your main pain? With what did you struggle specially?
    ● Would you apply this during your daily job? Why? Or why not?
    ● Even if you don’t apply TCR tomorrow, is there any other practice you
    would consider to apply?

    View Slide

  16. Some possible downsides of TCR
    ● What if it doesn’t even compile?
    ○ Problem: a typo/syntax problem triggers the revert
    ○ Possible solution: include previous step to build/compile, BTCR
    ● Vanishing tests
    ○ Problem: everything reverts, including the tests
    ○ Maybe not a real problem: it forces you to nano-steps when writing tests!
    ○ Possible “solutions”:
    ■ commit the test first being pending/skipped
    ■ pass the negation of the test
    ● False green
    ○ Problem: If you don’t go red first, you might be adding a test which does nothing
    ○ Possible solution: negate the test after passing, and see how it reverts

    View Slide

  17. Final recap
    ● Fast feedback is more important than ever…
    ● Forces nano-baby-steps
    ● Forces you to think: "how can I make this change with a smaller step?"
    ● High frustration at the beginning?
    ● Beware the downsides…

    View Slide

  18. Interesting links
    ● https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864
    ● https://rachelcarmena.github.io/2018/11/13/test-driven-programming-workflows.html
    ● https://medium.com/@barlindhaug/how-to-test-commit-revert-e850cd6e2520
    ● https://blog.adrianbolboaca.ro/2013/03/taking-baby-steps/
    ● Kent Beck screencast: https://www.youtube.com/watch?v=ZrHBVTCbcE0
    ● https://medium.com/@tdeniffel/test-commit-revert-questions-answered-ddf012a1af97
    ● https://medium.com/@tdeniffel/all-downsides-and-open-questions-of-tcr-885bfee27146
    ● https://www.davidtanzer.net/david's%20blog/2019/03/06/test-commit-revert.html
    ● https://medium.com/@itortv/i-implemented-the-mars-rover-kata-through-tcr-test-commit-reve
    rt-and-these-are-my-7e11c40983a6

    View Slide

  19. View Slide