Human-Written vs. AI-Generated Code: A Large-Scale Study of Defects, Vulnerabilities, and Complexity
Not on the map. Why?
Abstract (arXiv)
As AI code assistants become increasingly integrated into software development workflows, understanding how their code compares to human-written programs is critical for ensuring reliability, maintainability, and security. In this paper, we present a large-scale comparison of code authored by human developers and three state-of-the-art LLMs, i.e., ChatGPT, DeepSeek-Coder, and Qwen-Coder, on multiple dimensions of software quality: code defects, security vulnerabilities, and structural complexity. Our evaluation spans over 500k code samples in two widely used languages, Python and Java, classifying defects via Orthogonal Defect Classification and security vulnerabilities using the Common Weakness Enumeration. We find that AI-generated code is generally simpler and more repetitive, yet more prone to unused constructs and hardcoded debugging, while human-written code exhibits greater structural complexity and a higher concentration of maintainability issues. Notably, AI-generated code also contains more high-risk security vulnerabilities. These findings highlight the distinct defect profiles of AI- and human-authored code and underscore the need for specialized quality assurance practices in AI-assisted programming.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). First posted on arXiv 29 Aug 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 15.
16 papers.
Sort:
By area:
- 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Taskscited by 30
- 2026Measuring AI R&D Automationcited by 9
- 2026What to Cut? Predicting Unnecessary Methods in Agentic Code Generationcited by 6
- 2026Code Change Characteristics and Description Alignment: A Comparative Study of Agentic versus Human Pull Requestscited by 3
- 2026Let's Make Every Pull Request Meaningful: An Empirical Analysis of Developer and Agentic Pull Requestscited by 2
- 2026To What Extent Does Agent-generated Code Require Maintenance? An Empirical Studycited by 2
- 2025PIE: Performance Interval Estimation for Free-Form Generation Taskscited by 1
- 2026Mining Architectural Quality Under Agentic AI Adoption: A Causal Study of Java Repositoriescited by 1
- 2026Towards an Agent Operating System - Lessons from Classical and Cloud OScited by 1
- 2026Where Did the Variability Go? From Vibe Coding to Product Lines by Regenerationcited by 0
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomycited by 0
- 2026Generation of Web Apps with Agentic IDEs: An Empirical Assessmentcited by 0
4 more
- 2026AI Writes Code, Humans Pay the Debt. An Empirical Study on the Sustainability and Evolution of Agent-Generated Codecited by 0
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Codecited by 0
- 2026Between the Commits: Process, Error, and Claim Reliability in a Wholly AI-Authored Codebasecited by 0
- 2026CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?cited by 0
- 2026CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?29 Sep 2026
- 2026Between the Commits: Process, Error, and Claim Reliability in a Wholly AI-Authored Codebase24 Sep 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026Generation of Web Apps with Agentic IDEs: An Empirical Assessment21 Aug 2026
- 2026Towards an Agent Operating System - Lessons from Classical and Cloud OS27 Jul 2026
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomy23 Jul 2026
- 2026Where Did the Variability Go? From Vibe Coding to Product Lines by Regeneration17 Jun 2026
- 2026Mining Architectural Quality Under Agentic AI Adoption: A Causal Study of Java Repositories11 Jun 2026
- 2026AI Writes Code, Humans Pay the Debt. An Empirical Study on the Sustainability and Evolution of Agent-Generated Code6 Jun 2026
- 2026To What Extent Does Agent-generated Code Require Maintenance? An Empirical Study7 May 2026
- 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Tasks25 Mar 2026
- 2026Measuring AI R&D Automation4 Mar 2026
4 more
- 2026What to Cut? Predicting Unnecessary Methods in Agentic Code Generation19 Feb 2026
- 2026Let's Make Every Pull Request Meaningful: An Empirical Analysis of Developer and Agentic Pull Requests26 Jan 2026
- 2026Code Change Characteristics and Description Alignment: A Comparative Study of Agentic versus Human Pull Requests24 Jan 2026
- 2025PIE: Performance Interval Estimation for Free-Form Generation Tasks9 Sep 2025
- 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Taskscited by 30
- 2026What to Cut? Predicting Unnecessary Methods in Agentic Code Generationcited by 6
- 2026Code Change Characteristics and Description Alignment: A Comparative Study of Agentic versus Human Pull Requestscited by 3
- 2026Let's Make Every Pull Request Meaningful: An Empirical Analysis of Developer and Agentic Pull Requestscited by 2
- 2026To What Extent Does Agent-generated Code Require Maintenance? An Empirical Studycited by 2
- 2026Mining Architectural Quality Under Agentic AI Adoption: A Causal Study of Java Repositoriescited by 1
- 2026Towards an Agent Operating System - Lessons from Classical and Cloud OScited by 1
- 2026Generation of Web Apps with Agentic IDEs: An Empirical Assessmentcited by 0
- 2026AI Writes Code, Humans Pay the Debt. An Empirical Study on the Sustainability and Evolution of Agent-Generated Codecited by 0
- 2026Generation of Web Apps with Agentic IDEs: An Empirical Assessment21 Aug 2026
- 2026Towards an Agent Operating System - Lessons from Classical and Cloud OS27 Jul 2026
- 2026Mining Architectural Quality Under Agentic AI Adoption: A Causal Study of Java Repositories11 Jun 2026
- 2026AI Writes Code, Humans Pay the Debt. An Empirical Study on the Sustainability and Evolution of Agent-Generated Code6 Jun 2026
- 2026To What Extent Does Agent-generated Code Require Maintenance? An Empirical Study7 May 2026
- 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Tasks25 Mar 2026
- 2026What to Cut? Predicting Unnecessary Methods in Agentic Code Generation19 Feb 2026
- 2026Let's Make Every Pull Request Meaningful: An Empirical Analysis of Developer and Agentic Pull Requests26 Jan 2026
- 2026Code Change Characteristics and Description Alignment: A Comparative Study of Agentic versus Human Pull Requests24 Jan 2026
- 2026Measuring AI R&D Automationcited by 9
- 2025PIE: Performance Interval Estimation for Free-Form Generation Taskscited by 1
- 2026Where Did the Variability Go? From Vibe Coding to Product Lines by Regenerationcited by 0
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomycited by 0
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Codecited by 0
- 2026Between the Commits: Process, Error, and Claim Reliability in a Wholly AI-Authored Codebasecited by 0
- 2026CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?cited by 0
- 2026CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?29 Sep 2026
- 2026Between the Commits: Process, Error, and Claim Reliability in a Wholly AI-Authored Codebase24 Sep 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomy23 Jul 2026
- 2026Where Did the Variability Go? From Vibe Coding to Product Lines by Regeneration17 Jun 2026
- 2026Measuring AI R&D Automation4 Mar 2026
- 2025PIE: Performance Interval Estimation for Free-Form Generation Tasks9 Sep 2025