SoundCloud Nov 23, 2018

Integration Testing for Memory Leaks

Article Summary

Matthew Healy from SoundCloud reveals how a single integration test can catch memory leaks across an entire VIPER module. Unit tests alone won't save you from the sneaky leaks hiding in object interactions.

The SoundCloud iOS team faced a challenge: their VIPER architecture created multiple potential leak points (delegates, observers, closures) that were tedious to unit test individually. They needed a scalable approach to catch memory leaks without writing hundreds of tests.

Key Takeaways

Critical Insight

Integration tests that verify entire module deallocation provide maximum leak coverage with minimal test code, catching bugs that slip past unit tests.

The article hints at extending this pattern beyond memory testing to create a full integration test suite for VIPER modules.