Airbnb Eli Hart Mar 10, 2020

Better Android Testing at Airbnb (Part 2)

Article Summary

Airbnb's Android team was drowning in manual QA and flaky Espresso tests. Then they built a testing framework that changed everything.

Eli Hart from Airbnb Engineering shares how they transformed Android testing by building a comprehensive mocking system on top of MvRx (their open-source architecture library). This is Part 1 of a seven-part series on their testing infrastructure.

Key Takeaways

Critical Insight

Airbnb built a mocking framework that makes comprehensive Android testing fast, stable, and maintainable by freezing ViewModels to specific states and auto-generating test data.

The mocking system is just the foundation: Part 2 reveals how they use it to automate screenshot testing and catch UI regressions on CI.

About This Article

Problem

Airbnb's app grew to hundreds of screens managed by dozens of teams. Without heavy investment in automated testing, they couldn't catch regressions reliably before release.

Solution

Eli Hart's team built a system that automatically analyzes ViewModel state and generates Kotlin data classes in minutes. This eliminated the manual work of creating test data.

Impact

The mocking framework integrates into MvRx so developers can test any screen state instantly through the MvRx Launcher. Instead of navigating nested flows, they can access states with a single click.