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.

AI-generated code entropy management

Maersk builds feedback loops into AI codegen to outrun entropy at scale AI Engineer
TL;DW
  • AI-generated code creates entropy that balloons uncontrollably; small weekly sweeps with feedback loops prevent catastrophic rewrites better than attempting one massive cleanup.
  • Define 'right' collaboratively: business experts decide what changes are acceptable, developers trace system connections to find where automation helps, neither group sees the full picture alone.
  • Three-quarters of a large system is prose instructions, not code; prose needs engineering too—lint it like code, mutation-test it, keep one version that serves both agents and human reviewers.
  • Move decisions into prose, preparation into code: code fetches facts and validates context, experts own decision tables, model only picks a row; unmade decision tables escalate to humans.
  • Control what the model sees at runtime by passing data handles instead of full records; agents invent unnecessary actions when unnecessary data sits in their context.
  • Verification consumes 90% of agent time; rank evidence by what it proves—real task replays beat unit tests, write down what would disprove you before checking, every new check must fail once intentionally first.
  • A second agent with a checklist can't be talked into agreeing if it doesn't see the author's reasoning; don't trust one agent to judge its own work.
  • Build feedback loops into the system itself, not through one person: each loop writes to a ledger so changes don't wait on the architect's memory or attention.
  • Track blast radius before deploying new checks by replaying the rule over past sessions; deploy only where signals jump and failures cluster across related slices.
  • Retire code variants with evidence: if no real task executes a branch after refactoring, it's 'no evidence'—delete dead code only after proving nothing real reaches it.

Dmitry Buykin details how Maersk prevents AI-generated code sprawl across 110 countries: couple prose instructions with executable tests, use mutation testing to verify prose integrity, replay real tasks instead of relying on test suites, and instrument feedback loops so no single reviewer becomes a bottleneck.

AI code comprehension bottleneck

Feathers: AI code output outpaces human understanding; use projections and deliberate comparison to close the gap CraftHub Events (Craft Conference)
TL;DW
  • AI generates code faster than humans write legacy code, intensifying the need for understanding-first practices rather than code review bottlenecks.
  • Peter Naur's theory-building model: programming is not just writing code but developing tacit knowledge of system behavior, implications, and edge cases.
  • Use 'lensing'—asking AI scaled questions (five responsibilities, then three) to reveal different conceptualizations of the same system at different abstraction levels.
  • Projections: translate code into alternative forms (mathematical notation, state diagrams, other languages) to gain insights impossible from the original representation alone.
  • Delete all source code, keep tests, and have AI regenerate code to test its capability—reveals whether it truly understands the system or just passes surface-level tests.
  • Availability bias is your enemy: AI makes convenient decisions on your behalf (framework choice, scoring logic) you never explicitly requested and may tire of evaluating.
  • Before asking AI for help, struggle with the problem yourself first; this effort forms the neural connections needed to retain and apply knowledge deeply.
  • Ask AI 'what is unnecessary here?' to find architectural redundancies, dead code, and unneeded abstractions beyond simple duplication detection.
  • Request multiple solutions (ask for N implementations) and compare them to understand design tradeoffs and explore alternative approaches without contamination between outputs.
  • The more automation increases, the more capable humans must become: deep systems knowledge becomes essential when you're only called in for cases AI cannot handle.

Drawing on Peter Naur's theory-building model, Feathers argues the bottleneck is comprehensibility, not generation speed. Covers concrete techniques: scaled explanations, state-diagram projections, forcing N solutions instead of one, and struggling with a problem yourself before delegating—so skills migrate up to design rather than atrophying.