Headspace John Qualls, Greg Rami, and Anton Gerasimenko Mar 3, 2020

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.

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

About This Article

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.