Best Practices for Unit Testing at Revolut
Article Summary
Revolut's iOS team ships weekly updates with minimal regression. Their secret? Making unit tests actually fun to write.
Arsen Gasparyan from Revolut's mobile team breaks down the friction points that make developers avoid writing tests. He shares three practical patterns that transformed their testing workflow from a chore into a productive, enjoyable practice.
Key Takeaways
- Sample functions create test objects with default values, override only what matters
- MockFunc object replaces verbose closure based mocks with clean one liners
- Builder pattern moves setup noise out of test cases for better readability
- Each pattern solves specific friction: verbose setup, cluttered mocks, or noisy preparation
Critical Insight
Three simple patterns (sample functions, MockFunc, and builders) removed the friction that made iOS developers avoid writing unit tests at Revolut.