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
- MvRx architecture separates UI from business logic using immutable State classes
- Mock generation takes minutes via command-line script that reflectively analyzes ViewModels
- Custom DSL enables testing edge cases by creating State variants with minimal code
- MvRx Launcher lets developers jump to any screen with any mock state instantly
- Framework enables 100% code coverage without Espresso's flakiness or maintenance overhead
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.