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

Quality Assurance with Firebase

Quality Assurance with Firebase

This was a talk I gave in Kenya at a Firebase event in 2019

7cfaab5ac5113201604c3ad16d9a293b?s=128

Peter-John Welcome

August 28, 2019
Tweet

Transcript

  1. Quality Assurance with Firebase Peter-John Welcome @pjapplez Mobile Engineering Lead

  2. About me

  3. Firebase Quality Products • Robo Tests • Analysis Report •

    Action Report • Crash Reports • Stack traces • Tracking with logs • Performance Monitoring • Performance Tracing Test Lab Crashlytics Performance
  4. Firebase Test Lab

  5. Firebase Test Lab • Allows us to run Robo Tests

    (No Espresso Tests Required) • Supports APKs and AAB’s • Can Run UI (Espresso) Tests as daily checks. • Allows us to test on Real and Virtual Devices. • Gives us comprehensive reports. • Provides Screenshots and Crawling Graph • Performance Results of the app • Video records the full test • Has Cloud function functionality
  6. exports.handleTestMatrixCompletion = functions.testLab. testMatrix().onComplete(testMatrix => { switch (testMatrix.state) { case

    'FINISHED': console.log(`Test Lab Outcome${testMatrix.outcomeSummary}`); //SUCCESS: //FAILURE: //INCONCLUSIVE: //SKIPPED: break; default: console.log(`Completed with state ${testMatrix.state}`); } return null; }); Firebase Test Lab Cloud Function
  7. Firebase Crashlytics

  8. // Add dependency for Android implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' # Pods for

    iOS pod 'Fabric', '~> 1.10.2' pod 'Crashlytics', '~> 3.13.4' Firebase Crashlytics
  9. Firebase Crashlytics

  10. Demo Crashlytics

  11. Firebase Crashlytics • Automatic Crash reporting • Checks if bugs

    have regressed or are new. • Cloud function triggers to help with integrations. • Custom Keys help us trace our steps. • Analytics are also shown in the Log report. • Reports information about device that app is crashing on. • Velocity Alerts help us with recurring issues affecting users in almost real time. • Can check crashes for unique users with userIndentifier method.
  12. Firebase Crashlytics: Custom keys Crashlytics.setString(key, "foo" /* string value */)

    Crashlytics.setBool(key, true /* boolean value */) Crashlytics.setDouble(key, 1.0 /* double value */) Crashlytics.setFloat(key, 1.0f /* float value */) Crashlytics.setInt(key, 1 /* int value */)
  13. exports.sendOnNewIssue = functions.crashlytics.issue(). onNew(async (issue) => { }); exports.sendOnRegressedIssue =

    functions.crashlytics.issue(). onRegressed(async (issue) => { }); exports.sendOnVelocityAlert = functions.crashlytics.issue() .onVelocityAlert(async (issue) => { }); Firebase Crashlytics Cloud Function 3 Firebase triggers Crashlytics triggers:
  14. Firebase Crashlytics Integration function createJiraIssue(summary, description, priority) { const project_url

    = functions.config().jira.project_url; const user = functions.config().jira.user; const pass = functions.config().jira.pass; const issue_type = functions.config().jira.issue_type; const component_id = functions.config().jira.component_id; ... };
  15. Firebase Performance

  16. Firebase Performance

  17. Demo Firebase Performance

  18. Firebase Performance • Automatic performance reporting • HTTP Performance tracking

    Metrics • Custom Performance Traces
  19. Firebase Performance: Custom Traces import com.google.firebase.perf.FirebasePerformance; import com.google.firebase.perf.metrics.Trace; val myTrace

    = FirebasePerformance.getInstance().newTrace("test_trace") myTrace.start() cache.fetch()?.let { myTrace.incrementMetric("item_cache_hit", 1) } ?: run { myTrace.incrementMetric("item_cache_miss", 1) } myTrace.stop() val metric = FirebasePerformance.getInstance(). newHttpMetric(...,FirebasePerformance.HttpMethod.GET)
  20. Resources • https://firebase.google.com/docs/guides • https://github.com/firebase?utf8=%E2%9C%93&q=sample&type=&language= • https://www.youtube.com/channel/UCP4bf6IHJJQehibu6ai__cg • https://firebase.googleblog.com/ •

    https://twitter.com/Firebase
  21. Thanks! Contact me: https://medium.com/@pjwelcome @pjapplez pjwelcome@gmail.com Peter-johnwelcome.co.za https://github.com/pjwelcome