AI-generated code is faster to write but requires skilled review to catch security flaws and hallucinations—less experienced developers may ship bugs faster despite feeling more productive. The productivity paradox is real: while 84% of developers use AI coding tools, research shows experienced developers are sometimes slower when AI is enabled, yet junior developers who adopt AI more aggressively lack the expertise to catch critical vulnerabilities.
Does AI coding actually improve code quality, or just speed?
AI doesn't improve code quality—it trades review time for write time. Speed gains are genuine but concentrated in specific areas: 90% for boilerplate, 70% for tests, 65% for documentation. On established projects and work involving security considerations, experienced developers frequently encounter performance declines. The overlooked challenge is the effort required to validate outputs: approximately 27.3% of AI-generated snippets contain security vulnerabilities, and 45% of developers report that identifying and fixing problems in AI code consumes more time than writing comparable code manually.
This matters because the core question isn't whether AI coding improves code quality—it doesn't inherently. The real question is whether the hours saved on routine tasks offset the hours spent identifying and correcting flaws.
Where AI coding wins and where it creates debt
AI performs strongest on repetitive, templated work: creating project scaffolding (90% faster), building test cases (70% faster), writing supporting documentation (65% faster), and routine refactoring (50% faster). It falters with established systems, code requiring strict security protocols, and original algorithmic solutions. Complex project teams with senior developers see 19% productivity losses; newer developers gain speed but introduce more defects.
Productivity research indicates developers generate 12–15% additional code when using AI assistance [citation needed]. Studies examining AI-supported development revealed that seasoned contributors to open-source projects moved slower with AI enabled—yet reported subjective speed improvements. This disconnect between measured and perceived productivity creates genuine risk.
The advantages concentrate in predictable scenarios: a developer building a REST API endpoint in Express receives a complete template in moments rather than minutes. Writing unit tests gets structured outlines auto-populated. These represent legitimate efficiency improvements. However, someone remediating an SQL injection vulnerability that Copilot encoded into a string concatenation operation quickly negates those savings.
The security vulnerability problem AI coding can't ignore
Roughly 27% of AI-generated code snippets harbor security vulnerabilities. Frequent problems include non-existent API references, directory traversal weaknesses in file access, SQL injection through string-based queries, embedded secrets, and "ready for production" code containing unfinished TODO markers. Approximately 42% of snippets exhibit hallucinations—fabricated functions or missing dependencies [citation needed].
Security research on AI-generated code has documented SQL injection, cross-site scripting, and unsafe deserialization appearing in actual suggestions. A typical example: ChatGPT recommends a Fastify file serving implementation containing a directory traversal flaw—the implementation appears sound until someone supplies ../../etc/passwd as an input.
Even more problematic, hallucinations frequently appear legitimate. A non-existent library function or incorrect method signature won't trigger errors until execution or human inspection. A test suite showing 100% coverage but overlooking interaction scenarios between components won't reveal integration problems.
GitHub's research demonstrates that Copilot identifies formatting and minor errors reliably but overlooks SQL injection, cross-site scripting, and insecure deserialization—the categories of flaws that genuinely matter.
Why junior developers ship bugs faster with AI
Less-experienced developers embrace AI tools more eagerly and claim substantial productivity improvements—but possess insufficient background to identify nuanced security problems. During practical assessments, novice developers showed stronger speed advantages than experienced ones, yet lacked the technical foundation to properly assess safety and precision. Misplaced confidence intensifies this concern: developers sense AI enhanced their velocity even when it actually impaired it.
This reveals a troubling dynamic in how junior developers adopt AI coding. A less experienced developer deploying Copilot can construct an API endpoint in half the customary duration—a tangible productivity win. However, they cannot identify an exposed API credential in the configuration file, a database injection vulnerability in the query logic, or a directory traversal flaw in file operations. They deploy more rapidly.
In comparison, experienced developers invest additional effort examining AI-generated suggestions—partly because they recognize potential failure modes, partly because they maintain appropriate skepticism (justifiably). Stack Overflow's 2024 survey found only 29% of developers have confidence in AI tool precision. Between 46–68% encounter quality issues or inaccuracies and thoroughly review all outputs.
The review overhead is real and scales poorly
AI compresses development duration but expands review obligations. Companies saw improvements in merge request timelines with AI assistance—yet this ignores security validation labor, which proves inconsistent, fails to match production-scale demands, and frequently overlooks essential vulnerabilities. Subsequent manual inspection is demanding and time-consuming.
The misleading nature of merge request cycle metrics is that they measure completion speed, not outcome quality. If AI-assisted code moves four times quicker through reviews but harbors security vulnerabilities in 15% of submissions, your deployment velocity accelerates while your crisis management becomes reactive.
A notable exception contradicts this trend: Teams with extensive experience working on long-established systems and applying AI strictly to lower-risk infrastructure—avoiding mission-critical security layers—achieved productivity benefits without detectable quality degradation [citation needed].
Common questions about AI code quality
Does AI code actually work when you run it?
Approximately 55–60% of AI-generated code functions correctly on the initial attempt. However, "functional" differs from "protected" and "production-grade." Working code that passes basic compilation and validation often harbors undetected logic problems, security oversights, or outdated dependencies that create failures under demanding conditions or deliberate exploitation.
How much code do developers actually rewrite after AI generates it?
45% of developers indicate debugging AI-produced code demands more effort than manual construction. Another 66% identify "nearly functional, but flawed" as their primary complaint—the output seems acceptable initially but contains errors requiring troubleshooting and rework.
Can AI review its own code for security?
Not consistently. GitHub's analysis indicates Copilot dependably identifies formatting problems and simple errors but overlooks SQL injection, cross-site scripting, and insecure deserialization. Language models excel at recognizing common structures, not identifying potential threats.
Who benefits most from AI coding tools?
Experienced developers employing AI for template generation, testing frameworks, and supporting materials. Those gaining least are inexperienced developers requiring training in review processes but using tools that bypass this necessity.
Does productivity actually improve across a team?
Organization-wide effectiveness remains uncertain. Individual contributors report 12–15% increased code volume, though much represents lower-priority implementation. Validation requirements and handling incorrect generations frequently offset these gains in mature projects.
The honest takeaway
AI coding works. It genuinely accelerates template generation, test construction, and documentation creation. However, it doesn't enhance code quality—it demands competent review to prevent faster shipment of defects. The velocity improvement exists but applies narrowly; the quality danger persists and frequently remains hidden until systems fail.
The developers succeeding with AI leverage it for infrastructure generation, not expertise substitution. Junior developers should employ AI under required senior oversight. Experienced developers should direct it toward the 90% of work that's standardized. Organizations should restrict AI from security-critical implementations until verification systems advance.
The next post in this series covers building an AI coding workflow that actually catches mistakes—review gates, linting integration, and security scanning rules that make AI coding safe for teams.
References
- GitHub Blog: Copilot Code Review Limitations
- Stack Overflow Developer Survey 2024
