Targeted Code Coverage Reports For Android Continuous Builds
Article Summary
Brian Terczynski from Thumbtack reveals how their Android team solved a critical problem: developers couldn't see which specific lines in their code changes lacked test coverage. The solution? Two custom reports that pinpoint exactly where tests are missing.
Standard code coverage tools show overall codebase coverage, but they don't highlight what matters most during code review: which new or changed lines need tests. Thumbtack's Android team built lightweight Python scripts (150 lines each) that integrate with their CI pipeline to generate targeted, actionable coverage reports for every pull request.
Key Takeaways
- CR-specific coverage shows exactly which changed lines lack tests
- Coverage delta report reveals if PRs regress overall codebase coverage
- Custom 150-line Python scripts integrate with Jacoco and existing CI tools
- Team achieved >1% daily coverage increases during focused test-writing sprints
- Authors now proactively add tests after seeing targeted reports
Thumbtack's targeted coverage reports make it immediately obvious which lines need tests, leading to measurably more unit tests in code reviews and sustained coverage improvements.