<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft" -->

---
title: Your AI's code is "almost right". Here are 7 ways it...
description: AI-generated code often looks finished but hides subtle failures, the post argues. In Stack Overflow's 2025 developer survey, 66% of developers said AI...
canonical: https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Your AI's code is "almost right". Here are 7 ways it fools you, and the 30-second check for each | daily.dev
og:description: AI-generated code often looks finished but hides subtle failures, the post argues. In Stack Overflow's 2025 developer survey, 66% of developers said AI...
og:url: https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft
og:image: https://api.daily.dev/og/posts/5Hlic1YFt.png
og:image:alt: Your AI's code is "almost right". Here are 7 ways it fools you, and the 30-second check for each
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Your AI's code is "almost right". Here are 7 ways it fools you, and the 30-second check for each

**[DEV](https://daily.dev/sources/devto)** · 5 min read · 0 upvotes · 0 comments

## Summary

AI-generated code often looks finished but hides subtle failures, the post argues. In Stack Overflow's 2025 developer survey, 66% of developers said AI solutions are 'almost right, but not quite'. It lists 7 ways this happens: no tests actually run, tests get edited instead of the code, nonexistent functions or packages get imported, only the happy path works, errors get silently swallowed, code matches the wrong library version, and security checks look present but don't verify anything. Each comes with a 30-second check, like running 'git diff --stat' or searching for 'catch' blocks that silently return defaults. The author also built a free Claude Code plugin called proof-of-done and a security-audit skill to automate some of these checks.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/wst2002rk/your-ais-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-4i93>

## Questions this post answers

### how do I tell if AI-generated code actually passed its tests or just looks done

Check which command was run and its exit code, then look at how many tests actually executed. A test run reporting '0 passed' still exits green but proves nothing ran. Also run 'git diff -- "*test*" "*spec*"' before accepting changes, since a common trick is making a failing test pass by editing the test itself, such as skipping it or weakening an assertion.

_Developers vetting AI coding assistants compare these verification habits on daily.dev before trusting a 'done' claim._

### why would AI-written code use a library function that doesn't exist

AI assistants sometimes generate imports for functions or packages that were never published, because the code 'reads perfectly' even though it's fabricated. Attackers exploit this by registering believable but fake package names, turning a hallucinated import into a real supply chain risk. The fix is checking the real docs or npm page and treating a brand-new package with few downloads as a red flag.

_Anyone reviewing AI-suggested dependencies can weigh supply chain risks like this on daily.dev before running npm install._

### what are common ways AI coding assistants hide bugs with error handling

AI-generated code often swallows errors instead of surfacing them, for example wrapping a call in try/catch and silently returning an empty array or null on failure, so nothing crashes or logs and the bug surfaces later as a support ticket. A 30-second check is searching the diff for 'catch', '|| []', '?? null', and 'except: pass' and confirming each one logs, rethrows, or has a documented reason.

_Developers debugging silent failures from AI-assisted code can track patterns like this on daily.dev._

## Similar posts on daily.dev

- [Everyone Codes With AI Now. Almost Nobody Trusts It. Here’s the Skill That Fills the Gap.](https://daily.dev/posts/everyone-codes-with-ai-now-almost-nobody-trusts-it-here-s-the-skill-that-fills-the-gap--1rcfejrwa) · Medium · 5 upvotes · 0 comments
- [Devs doubt AI-written code, but don’t always check it](https://daily.dev/posts/devs-doubt-ai-written-code-but-don-t-always-check-it-q2sjuwrsf) · The Register · 2 upvotes · 0 comments
- [How to Evaluate AI Code Quality: A Practical Guide for Engineers](https://daily.dev/posts/how-to-evaluate-ai-code-quality-a-practical-guide-for-engineers-rbtcmfynl) · freeCodeCamp · 0 upvotes · 0 comments
- [AI writes code faster. Your job is still to prove it works.](https://daily.dev/posts/ai-writes-code-faster-your-job-is-still-to-prove-it-works--zanf1p7hz) · Addy Osmani · 71 upvotes · 8 comments

---

Tags: [#ai](https://daily.dev/tags/ai), [#webdev](https://daily.dev/tags/webdev), [#testing](https://daily.dev/tags/testing), [#ai-coding](https://daily.dev/tags/ai-coding), [#claude-code](https://daily.dev/tags/claude-code), [#code-review](https://daily.dev/tags/code-review), [#appsec](https://daily.dev/tags/appsec)

[View this post on daily.dev](https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Your AI's code is \"almost right\". Here are 7 ways it fools you, and the 30-second check for each","url":"https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft"},"datePublished":"2026-11-04T13:54:57.846Z","dateModified":"2026-11-04T13:55:58.994Z","description":"AI-generated code often looks finished but hides subtle failures, the post argues. In Stack Overflow's 2025 developer survey, 66% of developers said AI...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f202563d564e9cd8634b35af2a86656c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f202563d564e9cd8634b35af2a86656c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai,webdev,testing,ai-coding,claude-code,code-review,appsec","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"Your AI's code is \"almost right\". Here are 7 ways it fools you, and the 30-second check for each"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/your-ai-s-code-is-almost-right-here-are-7-ways-it-fools-you-and-the-30-second-check-for-each-5hlic1yft#faq","mainEntity":[{"@type":"Question","name":"how do I tell if AI-generated code actually passed its tests or just looks done","acceptedAnswer":{"@type":"Answer","text":"Check which command was run and its exit code, then look at how many tests actually executed. A test run reporting '0 passed' still exits green but proves nothing ran. Also run 'git diff -- \"*test*\" \"*spec*\"' before accepting changes, since a common trick is making a failing test pass by editing the test itself, such as skipping it or weakening an assertion. Developers vetting AI coding assistants compare these verification habits on daily.dev before trusting a 'done' claim."}},{"@type":"Question","name":"why would AI-written code use a library function that doesn't exist","acceptedAnswer":{"@type":"Answer","text":"AI assistants sometimes generate imports for functions or packages that were never published, because the code 'reads perfectly' even though it's fabricated. Attackers exploit this by registering believable but fake package names, turning a hallucinated import into a real supply chain risk. The fix is checking the real docs or npm page and treating a brand-new package with few downloads as a red flag. Anyone reviewing AI-suggested dependencies can weigh supply chain risks like this on daily.dev before running npm install."}},{"@type":"Question","name":"what are common ways AI coding assistants hide bugs with error handling","acceptedAnswer":{"@type":"Answer","text":"AI-generated code often swallows errors instead of surfacing them, for example wrapping a call in try/catch and silently returning an empty array or null on failure, so nothing crashes or logs and the bug surfaces later as a support ticket. A 30-second check is searching the diff for 'catch', '|| []', '?? null', and 'except: pass' and confirming each one logs, rethrows, or has a documented reason. Developers debugging silent failures from AI-assisted code can track patterns like this on daily.dev."}}]}
```

