Stop Wasting Time on Unit Testing: How Tokopedia Achieved 8X Faster Results | by Andrean Lay | Tokopedia Engineering | Medium
Article Summary
Tokopedia's iOS team was drowning in 30-minute unit test cycles with 65 developers fighting over 9 CI/CD machines. They cut that time by 8X.
Andrean Lay from Tokopedia Engineering shares their journey from running all unit tests sequentially to implementing selective testing. With hundreds of test targets and tens of thousands of test cases, their modular Bazel-based iOS app needed a smarter approach.
Key Takeaways
- Unified all test targets into one, dropping median time from 1772s to 563s
- Selective testing runs only affected modules and reverse dependencies
- Some PRs now achieve zero test time when changes don't impact code
- Final median test duration: 250s, with 8X overall improvement from baseline
Critical Insight
By testing only what changed plus its dependents, Tokopedia reduced unit test time from 30+ minutes to under 5 minutes on average.