Handing test code to AI boosted coverage 8x
Key point
Musinsa's iOS team used AI to mass-generate tests, raising coverage from 9.82% to 79%.
Details
Musinsa's mobile development team leveraged AI as the core tool for writing test code to raise iOS test coverage, which stood at just 9.82%, to 70% or higher. With 7 developers needing to handle routine feature development in parallel, they created a division of labor where AI handled repetitive test generation while developers focused on business logic verification and quality management.
The key was a document-based prompt system that got AI to write consistent tests. They separated purpose-specific documents like TEST_PLAN.md, 01-WRITING_TESTS.md, and 02-QUALITY_CHECK.md, and specified the principles AI must follow at the very top of each document.
- Confirm successful build and all tests passing before commit
- Achieve 70% or higher test coverage for each file
- Place tests exactly in the
Testsfolder within the module - No modifying production source code
On top of this, they added a step-by-step workflow, checkpoints, and grep-based automated verification to reduce inconsistent outcomes like AI verifying intermediate states or using Thread.sleep. All tests were unified under the Given-When-Then pattern, and function names were designed in Korean to make business rules explicit. ReactorKit dependencies were isolated using a Stub pattern, enabling AI to generate tests with predictable structure.
Execution was divided into three phases. In Phase 1, they first organized 60 Reactors, working for about 6 weeks from December 2025 to mid-January 2026, and coverage jumped from 9.82% → 48.15%. In Phase 2, they expanded to 36 files including Service, Repository, Handler, Helper, Utility, and Extension, raising coverage to 48% → 65%. For cases like CoreData Repository, where production code modification was unavoidably necessary for testing, they separated these into distinct PRs and rigorously verified side effects.
In Phase 3, they finished up the remaining 52 files and files under 70%, exceeding their target. Files like external SDK wrappers or React Native Bridge were excluded from measurement via coverage-config.yml to precisely manage the numbers, and coverage rose to 72.55% on Feb 12, 75.41% on Feb 13, and 79.04% on Feb 27. If PRs still under review get merged, they expect to reach 80% or higher.
On the operational side, they held weekly meetings for 3 months to address prompt improvements, quality issues, and edge cases, and automatically sent a Daily Coverage Report to Slack every day so the whole team could share the growth trend. They also added AI code review automation based on Claude Code, having AI review convention violations or simple fixes and handle automatic correction and commits via /fix, reducing the review bottleneck as well.
Ultimately, the key to this success wasn't AI itself, but the documentation, constraints, verification, and team operations needed to use AI properly. By entrusting repetitive test generation to AI while humans retained responsibility for business judgment and final quality, they strengthened both testing culture and code ownership together.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.