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

[Mateusz Herych] Release Android apps globally with no headache and minimum stress

[Mateusz Herych] Release Android apps globally with no headache and minimum stress

Presentation from GDG DevFest Ukraine 2017 - the biggest community-driven Google tech conference in the CEE.

Learn more at: https://devfest.gdg.org.ua

Google Developers Group Lviv

October 13, 2017
Tweet

More Decks by Google Developers Group Lviv

Other Decks in Technology

Transcript

  1. Mateusz Herych - Android Tech Lead @ IG - GDG

    Krakow co-organizer - Google Developer Expert, Android
  2. Mateusz Herych - Android Tech Lead @ IG - GDG

    Krakow co-organizer - Google Developer Expert, Android - Wow, that’s my fourth time here!
  3. Agenda for today - No single line of code, sorry!

    - Real-life developer’s horror stories about apps that break on production out of sudden
  4. Agenda for today - No single line of code, sorry!

    - Real-life developer’s horror stories about apps that break on production out of sudden - How do we rollout apps?
  5. Agenda for today - No single line of code, sorry!

    - Real-life developer’s horror stories about apps that break on production out of sudden - How do we rollout apps? - How do we monitor their health?
  6. Agenda for today - No single line of code, sorry!

    - Real-life developer’s horror stories about apps that break on production out of sudden - How do we rollout apps? - How do we monitor their health? - How do we rollout features?
  7. Agenda for today - No single line of code, sorry!

    - Real-life developer’s horror stories about apps that break on production out of sudden - How do we rollout apps? - How do we monitor their health? - How do we rollout features? - Takeaways
  8. Releasing mobile apps is tricky - Because if you introduce

    a bug… - ... there’s always somebody ...
  9. Releasing mobile apps is tricky - Because if you introduce

    a bug… - ... there’s always somebody … - … who will never, ever upgrade again.
  10. Releasing mobile apps is tricky - Because if you introduce

    a bug… - ... there’s always somebody … - … who will never, ever upgrade again. Plus majority of people won’t upgrade immediately.
  11. Offline app + sync - User does some changes locally,

    they’re stored in the database
  12. Offline app + sync - User does some changes locally,

    they’re stored in the database - Once something is stored in the database, SyncAdapter is triggered and stuff is synced to the server
  13. Offline app + sync - User does some changes locally,

    they’re stored in the database - Once something is stored in the database, SyncAdapter is triggered and stuff is synced to the server - Server syncs some other stuff back - i.e. changes made by other people, or by you on a different platform
  14. Offline app + sync - User does some changes locally,

    they’re stored in the database - Once something is stored in the database, SyncAdapter is triggered and stuff is synced to the server - Server syncs some other stuff back - i.e. changes made by other people, or by you on a different platform - KEY: changes in DB synced by the server don’t trigger sync
  15. Offline app + sync - User does some changes locally,

    they’re stored in the database - Once something is stored in the database, SyncAdapter is triggered and stuff is synced to the server - Server syncs some other stuff back - i.e. changes made by other people, or by you on a different platform - KEY: changes in DB synced by the server don’t trigger sync - OOOOPS.
  16. Typical way of fixing the bug on mobiles - Realize

    that the bug is there and what is the root cause
  17. Typical way of fixing the bug on mobiles - Realize

    that the bug is there and what is the root cause - If it’s critical, BEFORE you even ship a fixed build to the Google Play, speak to your backend collegues: can we actually apply a workaround on a backend?
  18. Typical way of fixing the bug on mobiles - Realize

    that the bug is there and what is the root cause - If it’s critical, BEFORE you even ship a fixed build to the Google Play, speak to your backend collegues: can we actually apply a workaround on a backend? - Then fix the mobile app, in most of the cases regardless if you have a workaround on a different layer or not.
  19. Typical way of fixing the bug on mobiles - Realize

    that the bug is there and what is the root cause - If it’s critical, BEFORE you even ship a fixed build to the Google Play, speak to your backend collegues: can we actually apply a workaround on a backend? - Then fix the mobile app, in most of the cases regardless if you have a workaround on a different layer or not. - Months after: deprecate the workaround when virtually nobody’s using that build anymore.
  20. IG Trading Android - ~25% of deals are made using

    Android. That’s a lot of money.
  21. IG Trading Android - ~25% of deals are made using

    Android. That’s a lot of money. - Huge brand risk if things break
  22. IG Trading Android - ~25% of deals are made using

    Android. That’s a lot of money. - Huge brand risk if things break - 20K transactions done every minute
  23. IG Trading Android - ~25% of deals are made using

    Android. That’s a lot of money. - Huge brand risk if things break - 20K transactions done every minute - … so yeah, maybe we’re not Facebook or Twitter, but...
  24. UI tests - Espresso - We run them in the

    Firebase Test Lab - For every Pull Request before we merge it
  25. UI tests - Espresso - We run them in the

    Firebase Test Lab - For every Pull Request before we merge it - On 3 different physical devices
  26. UI tests - Espresso - We run them in the

    Firebase Test Lab - For every Pull Request before we merge it - On 3 different physical devices - With 3 different Android versions
  27. UI tests - Espresso - We run them in the

    Firebase Test Lab - For every Pull Request before we merge it - On 3 different physical devices - With 3 different Android versions - QA are responsible for them
  28. UI tests - Espresso - We run them in the

    Firebase Test Lab - For every Pull Request before we merge it - On 3 different physical devices - With 3 different Android versions - QA are responsible for them - 93 automated acceptance scenarios, covering the most important features
  29. It’s not easy to get UI tests right. - They

    may hit real backend environment, thus make tests flaky
  30. It’s not easy to get UI tests right. - They

    may hit real backend environment, thus make tests flaky - … and slow.
  31. It’s not easy to get UI tests right. - They

    may hit real backend environment, thus make tests flaky - … and slow. - And sometimes it’s extremely hard to replicate some server edge-cases (What about some UI tests for server-connectivity errors?)
  32. It’s not easy to get UI tests right. - They

    may hit real backend environment, thus make tests flaky - … and slow. - And sometimes it’s extremely hard to replicate some server edge-cases (What about some UI tests for server-connectivity errors?) That’s why we introduced Mock Enviornment.
  33. It’s not easy to get UI tests right. - They

    may hit real backend environment, thus make tests flaky - … and slow. - And sometimes it’s extremely hard to replicate some server edge-cases (What about some UI tests for server-connectivity errors?) That’s why we introduced Mock Enviornment. Small framework over MockWebServer and Espresso to make it easy to mock stuff.
  34. Every 24 hours if - Crashes are fine - Main

    KPIs are okay - number of logins, number of signups, number of trades
  35. E.g. users can’t log in because you send a wrong

    request - obviously, it doesn’t crash either.
  36. Analyze KPIs, look on charts. Do they go up or

    down, in a weird way, right after your release?
  37. We use AppDynamics - It’s extremely easy to integrate -

    they offer a plugin for Gradle - Automaticaly instruments your OkHttp / Apache HTTP client / HttpUrlConnection code to track request’s metadata.
  38. We use AppDynamics - It’s extremely easy to integrate -

    they offer a plugin for Gradle - Automaticaly instruments your OkHttp / Apache HTTP client / HttpUrlConnection code to track request’s metadata. (sensitive information, like auth tokens is not included by default)
  39. We use AppDynamics - It’s extremely easy to integrate -

    they offer a plugin for Gradle - Automaticaly instruments your OkHttp / Apache HTTP client / HttpUrlConnection code to track request’s metadata. (sensitive information, like auth tokens is not included by default) - Also - crash rate calculation and bunch of other, standard analytics tools.
  40. Multiple strategies - Merging all stuff to master all the

    time. - Long running feature branches.
  41. Multiple strategies - Merging all stuff to master all the

    time. - Long running feature branches. - Development feature flags disabling the feature on production builds + mergin all stuff to master all the time.
  42. Development Feature Flag - Can be Shared Prefs - Can

    be compile-time constant - Best: multiple build flavors so unfinished feature isn’t even included in the bundle.
  43. Development Feature Flag - Can be Shared Prefs - Can

    be compile-time constant - Best: multiple build flavors so unfinished feature isn’t even included in the bundle. - Usually checked in 1 place - check whether to show an icon in the menu, Toolbar, etc.
  44. Feature Flag - Similar behavior to the Development Feature Flag

    - You control it remotely - You can switch it on / off per app version
  45. Feature Flag - Similar behavior to the Development Feature Flag

    - You control it remotely - You can switch it on / off per app version - … or per country
  46. Feature Flag - Similar behavior to the Development Feature Flag

    - You control it remotely - You can switch it on / off per app version - … or per country - … %
  47. Feature Flag - Similar behavior to the Development Feature Flag

    - You control it remotely - You can switch it on / off per app version - … or per country - … %
  48. Feature Flag - A/B testing - Making sure the feature

    works technically, on every phone in every country
  49. Feature Flag - A/B testing - Making sure the feature

    works technically, on every phone in every country - Making sure it works business-wise
  50. Feature Flag - A/B testing - Making sure the feature

    works technically, on every phone in every country - Making sure it works business-wise - Product Owner to decide when “it’s ready”.
  51. Feature Flag - A/B testing - Making sure the feature

    works technically, on every phone in every country - Making sure it works business-wise - Product Owner to decide when “it’s ready”. - You can turn stuff off is something gets in fire
  52. Feature Flag - A/B testing - Making sure the feature

    works technically, on every phone in every country - Making sure it works business-wise - Product Owner to decide when “it’s ready”. - You can turn stuff off is something gets in fire
  53. Conclusions - Automate as many things as you can -

    Prioritize your automation by amount of time you need to spend to test it manually
  54. Conclusions - Automate as many things as you can -

    Prioritize your automation by amount of time you need to spend to test it manually - Make your remote feature flags be checked in real-time - don’t require app’s process to be killed in order to apply a new setting
  55. Conclusions - Automate as many things as you can -

    Prioritize your automation by amount of time you need to spend to test it manually - Make your remote feature flags be checked in real-time - don’t require app’s process to be killed in order to apply a new setting - Don’t treat crashes as the only measurement of app’s stability.
  56. Conclusions - Automate as many things as you can -

    Prioritize your automation by amount of time you need to spend to test it manually - Make your remote feature flags be checked in real-time - don’t require app’s process to be killed in order to apply a new setting - Don’t treat crashes as the only measurement of app’s stability. - Make sure your tooling lets you spot issues before your customers report them.