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 full-size slide

  2. ?
    How long have you been
    programming professionally

    View full-size slide

  3. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

  4. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

  5. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

  6. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

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

    View full-size slide

  8. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

  9. Skill
    Time
    Beginner
    Intermediate
    Expert

    View full-size slide

  10. 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 full-size slide

  11. 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 full-size slide

  12. TCR is NOT
    • A successor to TDD

    • For writing production code

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. Android Studio Configuration

    View full-size slide

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

    View full-size slide

  20. • 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 full-size slide

  21. –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 full-size slide

  22. @ragunathjawahar
    Twitter / Medium / GitHub
    The End

    View full-size slide