Agent-driven test generation at scale

Duolingo agents merge 700+ test PRs, lifting MVVM coverage from 9% to 59% AI Engineer
TL;DW
  • Duolingo merged 700+ AI-generated test PRs adding 225,000 lines of test code using temporal workflows and Claude for code generation
  • MVVM test coverage increased from 9% to 59%, overall iOS coverage from 11% to 24% in 8 months using an identify-write-verify-resolve-iterate loop
  • Agents failed on lint rules, concurrency tests, and mixed testing frameworks; fixed via better examples, GitHub auto-fix actions, and running agents on Mac runners with local linting
  • File selection script scores files using type (view models 2.5x boost), architecture (MVVM preferred, legacy penalized), and size to predict agent success rates
  • PR lifecycle workflow uses git blame to assign PRs to top contributors of source code, enables auto-merge on approval, implements 30-day cooldown after rejections
  • LLM-as-judge reviewer rejects PRs that edit production code, modify existing tests, or add long waits; rejects included detailed feedback folded back into prompts
  • GitHub action auto-fixes lint errors in CI; removing non-autofixable lint rules reduced failures from 13.6% to lower rates and improved both agent and human developer velocity
  • Agent infrastructure runs on Dualingo's cloud coding platform built on Temporal, enabling async invocation from Slack/GitHub and detailed cost/event logging per run
  • Since March, pipeline wrote 34% of new test files, 44% of new test cases, 10% of Swift lines added; engineer-written tests increased recently as codebase confidence grew
  • Identify-write-verify-resolve-iterate pattern generalizes beyond testing to modernization, UI migration, and Android refactoring on same Temporal infrastructure

A Temporal-orchestrated pipeline uses Claude to identify, write, and verify iOS unit tests, then routes PRs via git blame. Eight months in: 225,000 lines merged, MVVM coverage at 59%, overall coverage at 24%. Key solves included enforcing architecture patterns and moving CI to macOS runners.