$30 off During Our Annual Pro Sale. View Details »

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. Quality Assurance with
    Firebase
    Peter-John Welcome
    @pjapplez
    Mobile Engineering Lead

    View Slide

  2. About me

    View Slide

  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

    View Slide

  4. Firebase Test Lab

    View Slide

  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

    View Slide

  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

    View Slide

  7. Firebase Crashlytics

    View Slide

  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

    View Slide

  9. Firebase Crashlytics

    View Slide

  10. Demo Crashlytics

    View Slide

  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.

    View Slide

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

    View Slide

  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:

    View Slide

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

    View Slide

  15. Firebase Performance

    View Slide

  16. Firebase Performance

    View Slide

  17. Demo Firebase Performance

    View Slide

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

    View Slide

  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)

    View Slide

  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

    View Slide

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

    View Slide