Are Coding Agents Generating Over-Mocked Tests? An Empirical Study
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Coding agents have received significant adoption in software development recently. Unlike traditional LLM-based code completion tools, coding agents work with autonomy (e.g., invoking external tools) and leave visible traces in software repositories, such as authoring commits. Among their tasks, coding agents may autonomously generate software tests; however, the quality of these tests remains uncertain. In particular, excessive use of mocking can make tests harder to understand and maintain. This paper presents the first study to investigate the presence of mocks in agent-generated tests of real-world software systems. We analyzed over 1.2 million commits made in 2025 in 2,168 TypeScript, JavaScript, and Python repositories, including 48,563 commits by coding agents, 169,361 commits that modify tests, and 44,900 commits that add mocks to tests. Overall, we find that coding agents are more likely to modify tests and to add mocks to tests than non-coding agents. We detect that (1) 60% of the repositories with agent activity also contain agent test activity; (2) 23% of commits made by coding agents add/change test files, compared with 13% by non-agents; (3) 68% of the repositories with agent test activity also contain agent mock activity; (4) 36% of commits made by coding agents add mocks to tests, compared with 26% by non-agents; and (5) repositories created recently contain a higher proportion of test and mock commits made by agents. Finally, we conclude by discussing implications for developers and researchers. We call attention to the fact that tests with mocks may be potentially easier to generate automatically (but less effective at validating real interactions), and the need to include guidance on mocking practices in agent configuration files.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 25 of its 58 references that are in the map. First posted on arXiv 30 Jan 2026.
Builds on
25 of 58 references.
Closest ancestors · 6
Same direction, newest first
- 2026Promises, Perils, and (Timely) Heuristics for Mining Coding Agent Activity26 Jan
- 2026Agentic Much? Adoption of Coding Agents on GitHub26 Jan
- 2025Understanding Software Engineering Agents: A Study of Thought-Action-Result Trajectories23 Jun
- 2025Why AI Agents Still Need You: Findings from Developer-Agent Collaborations in the Wild14 Jun
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repair25 Mar
Other references · 19
- 2024AutoCodeRover: Autonomous Program Improvementcited by 272
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
- 2025Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivitycited by 93
- 2024Automated Unit Test Improvement using Large Language Models at Metacited by 73
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
- 2024Test-Driven Development for Code Generationcited by 32
- 2024TDD-Bench Verified: Can LLMs Generate Tests for Issues Before They Get Resolved?cited by 32
- 2023Refactoring Programs Using Large Language Models with Few-Shot Examplescited by 27
- 2025Mutation-Guided LLM-based Test Generation at Metacited by 23
- 2021Sampling Projects in GitHub for MSR Studiescited by 20
- 2024Unveiling ChatGPT's Usage in Open Source Projects: A Mining-based Studycited by 16
7 more
- 2015Untangling Fine-Grained Code Changescited by 10
- 2024Automatic Library Migration Using Large Language Models: First Resultscited by 9
- 2023Can GPT-4 Replicate Empirical Software Engineering Research?cited by 7
- 2024Feature-Driven End-To-End Test Generationcited by 6
- 2021How Developers Engineer Test Cases: An Observational Studycited by 3
- 2025Self-Admitted GenAI Usage in Open-Source Softwarecited by 3
- 2024Automatically Removing Unnecessary Stubbings from Test Suitescited by 1
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026Agentic Repository Mining: A Multi-Task Evaluationcited by 0
- 2026How Do AI Coding Agents Contribute to Software Development? an Empirical Study of Agentic Pull Requestscited by 0
- 2026Validation Evidence in LLM Repair Agents: How Much of What Passes Actually Tests the Bug?cited by 0
- 2026Introducing Consort: A Spec-First Agent Framework for Enforced, Test-Driven Development on Live Database Branchescited by 0
- 2026Chronicle: Cut-Point Replay for Regression Testing of LLM Agentscited by 0
- 2026Chronicle: Cut-Point Replay for Regression Testing of LLM Agents17 Sep 2026
- 2026Introducing Consort: A Spec-First Agent Framework for Enforced, Test-Driven Development on Live Database Branches9 Sep 2026
- 2026Validation Evidence in LLM Repair Agents: How Much of What Passes Actually Tests the Bug?30 Jul 2026
- 2026How Do AI Coding Agents Contribute to Software Development? an Empirical Study of Agentic Pull Requests23 Jul 2026
- 2026Agentic Repository Mining: A Multi-Task Evaluation6 May 2026
Similar, not cited
Close in wording, no citation either way
- 2026Do Autonomous Agents Contribute Test Code? A Study of Tests in Agentic Pull Requests
- 2026Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents
- 2026Test Coverage Analysis of Agentic Pull Requests
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
- 2026Beyond Test Presence: Assessing the Quality and Robustness of Agent-Generated Tests in Open-Source Projects
- 2026VibeCheck: Assessing the Quality of LLM-Generated Unit Tests: A Multi-agent Empirical Study across Heterogeneous Repositories
- 2026Human-Agent versus Human Pull Requests: A Testing-Focused Characterization and Comparison
- 2026Automated structural testing of LLM-based agents: methods, framework, and case studies