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

Peter-John Welcome

August 28, 2019
Tweet

More Decks by Peter-John Welcome

Other Decks in Technology

Transcript

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

    Action Report • Crash Reports • Stack traces • Tracking with logs • Performance Monitoring • Performance Tracing Test Lab Crashlytics Performance
  2. 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
  3. 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
  4. // 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
  5. 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.
  6. 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 */)
  7. 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:
  8. 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; ... };
  9. 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)