Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reimagining Android Productivity with TCR

Reimagining Android Productivity with TCR

What slows us down? Bad code. Code that won't compile, code that breaks the functionality, code that doesn't do what it is supposed to do. What if someone waved a magic wand and made bad code disappear in a snap? Imagine a world where everyone checks-in only good code. Now, that opens up a lot of possibilities.

TCR (test && commit || revert) is a relatively new workflow invented by Kent Beck (the person behind Test-Driven Development). The idea is simple – write tests and production code. If the tests pass, the code gets checked-in automatically. If it fails, then the tooling performs a "git reset --hard", thereby discarding any code that was written (both test and production). You may have a lot of mixed feelings about this and so did I, but it works!

TCR on the surface starts off with a lot of mixed feelings but is surprisingly fast and effective. In this talk, I’ll demonstrate how we can use TCR to build a mobile app in Kotlin using Android Studio.

Ragunath Jawahar

November 02, 2019
Tweet

More Decks by Ragunath Jawahar

Other Decks in Programming

Transcript

  1. test && commit ||
    revert
    Ragunath Jawahar / @ragunathjawahar

    View Slide

  2. ?
    How long have you been
    programming professionally

    View Slide

  3. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  4. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  5. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  6. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  7. Skill
    Time
    Beginner
    Intermediate
    Expert
    Even if we show up EVERYDAY and work really HARD!

    View Slide

  8. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  9. Skill
    Time
    Beginner
    Intermediate
    Expert

    View Slide

  10. View Slide

  11. View Slide

  12. Deliberate Practice
    • Identify the skill that you want to build

    • Break it down to individual sub-skills

    • Spend 45-90 minutes and a maximum of 3 session practice sessions

    • Get brutal feedback

    • Work on the feedback and repeat

    View Slide

  13. TCR

    View Slide

  14. TCR is a technique to,
    • Train yourself to break a large problem into smaller manageable pieces

    • Engage in deliberate practice that warrants focus and concentration

    • Practice writing good tests and production code

    View Slide

  15. TCR is NOT
    • A successor to TDD

    • For writing production code

    View Slide

  16. ./gradlew app:test && git commit -am [Yay!] || git reset --hard

    View Slide

  17. ./gradlew app:test && git commit -am [Yay!] || git reset --hard

    View Slide

  18. ./gradlew app:test && git commit -am [Yay!] || git reset --hard

    View Slide

  19. ./gradlew app:test && git commit -am [Yay!] || git reset --hard

    View Slide

  20. ./gradlew app:test && git commit -am [Yay!] || git reset --hard

    View Slide

  21. Android Studio Configuration

    View Slide

  22. 1/2

    View Slide

  23. 2/2

    View Slide

  24. –Kent Beck
    “I hated the idea so I had to try it.”

    View Slide


  25. View Slide


  26. View Slide

  27. View Slide

  28. • test && commit || revert

    https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864

    • Kent Beck’s Substring Problem, TCR Style

    https://www.youtube.com/watch?v=ZrHBVTCbcE0

    • Kent Beck — Explore, Expand, Extract; TCR and Limbo!

    https://sourcediving.com/kent-beck-explore-expand-extract-tcr-and-limbo-b007b397c12e

    Making Badass Developers - Kathy Sierra (Serious Pony) keynote
    • Making Badass Developers - Kathy Sierra (Serious Pony) Keynote

    https://www.youtube.com/watch?v=FKTxC9pl-WM&t=1004s

    • TCR (test && commit || revert). How to use? Alternative to TDD?

    https://medium.com/@tdeniffel/tcr-test-commit-revert-a-test-alternative-to-tdd-6e6b03c22bec

    • How to Learn Anything... Fast - Josh Kaufman

    https://www.youtube.com/watch?v=EtJy69cEOtQ

    • Bench Press (Shameless plug)

    https://github.com/ragunathjawahar/bench-press

    View Slide

  29. –Ira Glass
    “I feel like your problem is that you’re trying to
    judge all the things in the abstract before you
    do them. That’s your tragic mistake.”

    View Slide

  30. @ragunathjawahar
    Twitter / Medium / GitHub
    The End

    View Slide