Headspace John Qualls, Greg Rami, and Anton Gerasimenko

Headspace: Our Android testing process

Original post Our Android testing process

Article Summary

Headspace went from <20% test coverage to 80%+ during a complete app rewrite. Here's how they built a testing strategy that actually works.

The Headspace Android team shares their journey from minimal testing to a robust, multi-layered testing strategy. They detail how they balance speed with confidence using unit tests, integration tests, and E2E tests across 4,600+ test cases.

Key Takeaways

Critical Insight

By tiering tests strategically and investing in tooling (Report Portal, Flank, MockWebServer), Headspace catches critical bugs pre-release without slowing down PRs.

Continue reading

What This Article Covers

Problem

Headspace's E2E tests on Firebase Test Lab were unreliable. Network issues, REST API failures, and device problems kept breaking the CI pipeline, which made developers stop trusting the test suite.

Solution

The team switched to UI Integration Tests with OkHttp's MockWebServer to mock network requests. This replaced the flaky E2E tests with fast, reliable tests that could actually block pull requests.

Impact

Without external dependencies, the integration tests became stable enough to automatically prevent PRs from merging. Developers could ship code faster and had real confidence in quality without needing to manually review test results.

Their approach to handling test flakiness and the custom reporting solution they built might change how you think about mobile CI/CD.

This page summarizes “Our Android testing process” by Headspace, published Mar 3, 2020. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for Android

Browse all AI tools →