Ideas from AI Engineer talks Curated by Alex Vidal (@dobleio) and Borja Pérez (@borjaperfra) 76 ideas · 101 talks · 5 events

The Engineering Brief

Duolingo aimed its test agent at testable code and built a workflow to merge its PRs

Kush Agrawal describes how Duolingo backfilled iOS unit tests with coding agents: a scoring script picks files an agent can test well, and a scheduled state machine repairs, routes or closes the agent's PRs. More than 700 merged, each approved by a human.

Kush AgrawalDuolingoAIE CODE 20263 min read
Watch from 1:01

Recording by AI Engineer.

The idea

The speaker’s argument, in our words.

In Agrawal's account most of the engineering sits around the agent, before and after it writes a test. Before, the team chose where it should work. About half of the iOS app follows MVVM and the rest is legacy, so they targeted the MVVM half, and a selector script ranks every Swift file by how confident they are that an agent can test it well: view models, repositories and data sources move up, legacy and large files move down, UI code is skipped. A small local pilot came first, to learn how agents fail, and some of the fixes changed the codebase itself, such as moving a hard-to-mock singleton to its protocol version behind a lint rule.

After, a scheduled backfill produced more open PRs than anyone could manage by hand. A second workflow on Temporal, a durable workflow engine, runs every couple of hours and takes one action on each generated-test PR: close it, skip it, assign the top git blame contributor of the tested file as reviewer, or send it to repair. Pre-commit failures get deterministic fixes, agent repairs are capped, and a file a reviewer rejected goes into a cooldown. Every merge still needs a human approval.

What they found

From the talk. Figures are self-reported unless stated.
  • A selector scores every Swift file on confidence that an agent can test it well: view models, repositories and data sources get a 2.5x boost, legacy files are pushed down, UI code is skipped (snapshot tests suit it better) and large files are penalized.

    The project targeted the MVVM half of the app, about half the codebase, as the easiest to test. Weights other than the 2.5x boost are not given.

    Technical recommendation

    6:00
  • Local pilot: first batch 17 PRs with 8 merged, second batch 40 PRs with 19 merged, roughly a 50% merge rate.

    Self-reported, two small batches. The speaker says the goal was to learn failure modes, not to merge many PRs.

    Measured result

    4:31
  • Every couple of hours a workflow takes one action on each open generated-test PR: close it (merge conflicts or about three weeks open), skip it (CI running or a reviewer on it), assign the top git blame contributor of the tested file, or repair it. Pre-commit failures get a deterministic GitHub Action fix; test failures go to an agent, capped at five attempts. A rejected file enters a 30-day cooldown.

    Built once the scheduled backfill left tens to hundreds of open PRs that nobody could manage by hand.

    Case study

    7:31
  • More than 700 test PRs merged, about 225,000 lines of test code, each reviewed and approved by a human; MVVM coverage rose from 9% to 59% and overall coverage from 11% to 24%.

    Self-reported by Duolingo. Starting figures are from March, end figures about eight months later; engineers also wrote tests in that period. The talk's opening line is transcribed as '200,000,000 lines', a mishearing; 10:51 says about 225,000.

    Measured result

    10:51

Why it matters

Our reading. Not said in the talk.

Demos of coding agents usually stop when the PR opens. Duolingo's account puts the work before and after that point: choosing code the agent can test well, treating repeated failures as signals about the codebase, and keeping a batch of agent PRs from swamping reviewers.

What one could try

  • Score candidate files for agent-written tests by structure and size, and run a small local batch, categorizing every rejection, before scheduling anything.
  • Label agent PRs and write their lifecycle as an explicit decision tree (close, skip, assign, repair) with a cap on repair attempts.
  • Record reviewer rejections per file and suppress new attempts for a fixed period.

Limitations

  • Self-reported by Duolingo, with no non-agent baseline; engineers also wrote tests in the same period, so the coverage gain is not the agent's alone.
  • Merged-PR counts say nothing about the long-term value of the tests, which the talk does not measure.
  • Results cover unit tests on the MVVM half of one iOS codebase, chosen because it was the easiest to test.

Original sources

This is our synthesis of the talk, checked against the transcript at the linked moments.

Related ideas