Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

About me

Slide 3

Slide 3 text

Firebase Quality Products ● Robo Tests ● Analysis Report ● Action Report ● Crash Reports ● Stack traces ● Tracking with logs ● Performance Monitoring ● Performance Tracing Test Lab Crashlytics Performance

Slide 4

Slide 4 text

Firebase Test Lab

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Firebase Crashlytics

Slide 8

Slide 8 text

// 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

Slide 9

Slide 9 text

Firebase Crashlytics

Slide 10

Slide 10 text

Demo Crashlytics

Slide 11

Slide 11 text

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.

Slide 12

Slide 12 text

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 */)

Slide 13

Slide 13 text

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:

Slide 14

Slide 14 text

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; ... };

Slide 15

Slide 15 text

Firebase Performance

Slide 16

Slide 16 text

Firebase Performance

Slide 17

Slide 17 text

Demo Firebase Performance

Slide 18

Slide 18 text

Firebase Performance ● Automatic performance reporting ● HTTP Performance tracking Metrics ● Custom Performance Traces

Slide 19

Slide 19 text

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)

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

Thanks! Contact me: https://medium.com/@pjwelcome @pjapplez [email protected] Peter-johnwelcome.co.za https://github.com/pjwelcome