MVI Architecture in Kotlin Multiplatform - Part 3
Article Summary
Arkadii Ivanov from Bumble Tech tackles the biggest challenge in Kotlin Multiplatform testing: no mocking frameworks. His solution? Embrace it as a feature, not a bug.
This is the final part of a three-part series on implementing MVI architecture in Kotlin Multiplatform. Ivanov covers the Kittens module with comprehensive unit and integration tests, demonstrating how to test shared code that runs on both iOS and Android without traditional mocking tools.
Key Takeaways
- Tests automatically run against all platforms—write once, multiply coverage by target count
- Fakes over mocks force better abstractions and cleaner code that's easier to modify
- TestScheduler simulates Kotlin/Native's tricky memory model without flaky multithreading
- Integration tests cover everything except UI rendering using common test code
- Manual processing mode enables testing network delays and loading states precisely
Critical Insight
Writing test implementations instead of using mocks creates more maintainable code that automatically validates against platform-specific quirks like Kotlin/Native's memory model.