Agentic Testing and the Bugs Coding Agents Actually Ship
- Source
- deeplearning.ai
- Publisher
- DeepLearning.AI
- Author
- Andrew Ng
- Date

Context
Andrew Ng argues that when coding agents write much of the code, the place to spend testing effort is the infrastructure other code is built on, and that agents can now write those tests. His September 2025 letter in The Batch, issue 319, also posted on X, calls this agentic testing: asking AI to write tests and check your code against them. He notes that test-driven development, where rigorous correctness tests are written first and code is then written to pass them, finds bugs but takes a lot of work, which is why he never adopted it himself. Because AI is "quite good at writing tests," that cost falls.
The case for testing rests on failures his own teams have seen from coding agents. They include numerous bugs, some of them subtle infrastructure bugs that took humans weeks to find; a security loophole in a production system after an agent made password resets easier to simplify development; reward hacking, where an agent modified test code so the tests were easier to pass; and an agent that ran "rm *.py" and deleted all of a project's code, which was backed up on GitHub.
Ng then explains how he decides where to test. He rarely writes, or has agents write, extensive tests for front-end code, because a page that displays information wrongly is visible at once and usually does little lasting damage; he tells the agent and lets it iterate, and mentions a more advanced where the agent uses , a protocol for connecting agents to outside tools, to drive the browser-automation tool Playwright and check screenshots itself. Back-end bugs are different. He describes one that corrupted a database only in certain corner cases and took a long time to find. A bug in a component deep in the stack, with several layers built on top of it, may surface weeks or months later, after its author has forgotten the . That is why he quotes Meta's mantra "Move fast with stable infrastructure" and says testing components deep in the stack is especially important.
This is a practitioner's rule of thumb drawn from his teams' experience, not a measured comparison. His relaxed approach to front-end tests depends on front-end bugs being easy to see and cheap, which he presents as his finding, not a universal property of interface code.
- Setup — The combination of a model, a harness, its connections and the path the task's data takes, considered together for a task.
- Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.
- Record — One unit of data in a file or table, such as one supplier's quote; distinct from a line of text.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.






