Developer-driven automated testing is vital to the ongoing health and quality of a codebase. It does, however, come with a noticeable cost. This is especially true of UI testing — an area often avoided by even the most test-friendly of developers. In this two-part blog post, we explore how the Slack Android team made authoring and maintaining…
Overview
This article discusses the integration of UI testing into the Android development workflow at Slack, emphasizing the importance of developer-driven automated testing for maintaining code quality. It outlines strategies for making UI tests stable and effective, while also addressing common developer concerns about UI testing.
What You'll Learn
How to integrate UI testing into the Android development workflow
Why maintaining a stable UI test suite is crucial for developer confidence
How to create targeted and hermetic UI tests to reduce flakiness
Prerequisites & Requirements
- Understanding of automated testing principles
- Familiarity with Android development tools and frameworks(optional)
Key Questions Answered
What are the benefits of authoring UI tests as a developer?
How can developers ensure the stability of their UI tests?
What strategies did Slack implement to improve UI testing?
What are the common concerns developers have about UI testing?
Key Statistics & Figures
Technologies & Tools
Key Actionable Insights
1Developers should start integrating UI tests into their workflow immediately to avoid the pitfalls of deferred testing.Delaying testing can lead to increased technical debt and a lack of confidence in code changes, especially as project complexity grows.
2Implement targeted UI tests that focus on specific functionalities rather than navigating through the entire application.This approach reduces test execution time and minimizes the likelihood of failures due to unrelated code paths.
3Utilize dependency injection frameworks like Dagger to manage application state in tests effectively.By controlling the application state, developers can create more reliable tests that do not depend on the full application lifecycle.