[{"data":1,"prerenderedAt":364},["ShallowReactive",2],{"blog-post-blog_en-ki-generierten-code-richtig-reviewen":3},{"id":4,"title":5,"body":6,"cover":349,"date":350,"description":351,"draft":352,"extension":353,"meta":354,"navigation":175,"path":355,"seo":356,"stem":357,"tags":358,"__hash__":363},"blog_en\u002Fen\u002Fblog\u002Fki-generierten-code-richtig-reviewen.md","Reviewing AI-Generated Code: Different Standards, Different Risks",{"type":7,"value":8,"toc":344},"minimark",[9,13,18,21,56,60,63,298,301,327,331,340],[10,11,12],"p",{},"AI-generated code passes syntax checks, compiles, and often looks clean. The same properties that make it easy to approve are precisely what conceals its most common failure modes. The problem is not the obvious error, it is the plausibly correct code that fails under specific conditions.",[14,15,17],"h2",{"id":16},"how-ai-generated-code-fails","How AI-Generated Code Fails",[10,19,20],{},"AI models optimise for the happy path. The result is code that works in common scenarios but breaks at the edges:",[22,23,24,32,38,44,50],"ul",{},[25,26,27,31],"li",{},[28,29,30],"strong",{},"Plausible but wrong logic in edge cases:"," Calculations, comparisons, and state machines look correct but make false assumptions about inputs outside the normal range.",[25,33,34,37],{},[28,35,36],{},"Security issues in authentication and authorisation patterns:"," AI models frequently reproduce outdated or simplified patterns from public training data.",[25,39,40,43],{},[28,41,42],{},"Missing error handling:"," Because the model is trained on the success case, handling for network failures, timeouts, and inconsistent states is often absent.",[25,45,46,49],{},[28,47,48],{},"Subtle data type errors:"," Mistakes that only surface under production load, such as integer overflows or implicit type conversions.",[25,51,52,55],{},[28,53,54],{},"Deprecated patterns from training data:"," Outdated APIs, old library versions, or patterns that have not been recommended for years.",[14,57,59],{"id":58},"a-different-review-focus","A Different Review Focus",[10,61,62],{},"The central question when reviewing AI-generated code is not \"does this look correct?\" but \"what assumptions does this code make?\"",[64,65,70],"pre",{"className":66,"code":67,"language":68,"meta":69,"style":69},"language-typescript shiki shiki-themes github-light github-dark","\u002F\u002F AI-generated function: looks correct, but is not\nasync function getUserBalance(userId: string): Promise\u003Cnumber> {\n  const user = await db.users.findOne({ id: userId });\n  return user.account.balance; \u002F\u002F bug: no null check, no error handling\n}\n\n\u002F\u002F Correct version\nasync function getUserBalance(userId: string): Promise\u003Cnumber> {\n  const user = await db.users.findOne({ id: userId });\n  if (!user || !user.account) {\n    throw new Error(`User or account not found: ${userId}`);\n  }\n  return user.account.balance;\n}\n","typescript","",[71,72,73,82,128,152,164,170,177,183,212,229,253,279,285,293],"code",{"__ignoreMap":69},[74,75,78],"span",{"class":76,"line":77},"line",1,[74,79,81],{"class":80},"sJ8bj","\u002F\u002F AI-generated function: looks correct, but is not\n",[74,83,85,89,92,96,100,104,107,111,114,116,119,122,125],{"class":76,"line":84},2,[74,86,88],{"class":87},"szBVR","async",[74,90,91],{"class":87}," function",[74,93,95],{"class":94},"sScJk"," getUserBalance",[74,97,99],{"class":98},"sVt8B","(",[74,101,103],{"class":102},"s4XuR","userId",[74,105,106],{"class":87},":",[74,108,110],{"class":109},"sj4cs"," string",[74,112,113],{"class":98},")",[74,115,106],{"class":87},[74,117,118],{"class":94}," Promise",[74,120,121],{"class":98},"\u003C",[74,123,124],{"class":109},"number",[74,126,127],{"class":98},"> {\n",[74,129,131,134,137,140,143,146,149],{"class":76,"line":130},3,[74,132,133],{"class":87},"  const",[74,135,136],{"class":109}," user",[74,138,139],{"class":87}," =",[74,141,142],{"class":87}," await",[74,144,145],{"class":98}," db.users.",[74,147,148],{"class":94},"findOne",[74,150,151],{"class":98},"({ id: userId });\n",[74,153,155,158,161],{"class":76,"line":154},4,[74,156,157],{"class":87},"  return",[74,159,160],{"class":98}," user.account.balance; ",[74,162,163],{"class":80},"\u002F\u002F bug: no null check, no error handling\n",[74,165,167],{"class":76,"line":166},5,[74,168,169],{"class":98},"}\n",[74,171,173],{"class":76,"line":172},6,[74,174,176],{"emptyLinePlaceholder":175},true,"\n",[74,178,180],{"class":76,"line":179},7,[74,181,182],{"class":80},"\u002F\u002F Correct version\n",[74,184,186,188,190,192,194,196,198,200,202,204,206,208,210],{"class":76,"line":185},8,[74,187,88],{"class":87},[74,189,91],{"class":87},[74,191,95],{"class":94},[74,193,99],{"class":98},[74,195,103],{"class":102},[74,197,106],{"class":87},[74,199,110],{"class":109},[74,201,113],{"class":98},[74,203,106],{"class":87},[74,205,118],{"class":94},[74,207,121],{"class":98},[74,209,124],{"class":109},[74,211,127],{"class":98},[74,213,215,217,219,221,223,225,227],{"class":76,"line":214},9,[74,216,133],{"class":87},[74,218,136],{"class":109},[74,220,139],{"class":87},[74,222,142],{"class":87},[74,224,145],{"class":98},[74,226,148],{"class":94},[74,228,151],{"class":98},[74,230,232,235,238,241,244,247,250],{"class":76,"line":231},10,[74,233,234],{"class":87},"  if",[74,236,237],{"class":98}," (",[74,239,240],{"class":87},"!",[74,242,243],{"class":98},"user ",[74,245,246],{"class":87},"||",[74,248,249],{"class":87}," !",[74,251,252],{"class":98},"user.account) {\n",[74,254,256,259,262,265,267,271,273,276],{"class":76,"line":255},11,[74,257,258],{"class":87},"    throw",[74,260,261],{"class":87}," new",[74,263,264],{"class":94}," Error",[74,266,99],{"class":98},[74,268,270],{"class":269},"sZZnC","`User or account not found: ${",[74,272,103],{"class":98},[74,274,275],{"class":269},"}`",[74,277,278],{"class":98},");\n",[74,280,282],{"class":76,"line":281},12,[74,283,284],{"class":98},"  }\n",[74,286,288,290],{"class":76,"line":287},13,[74,289,157],{"class":87},[74,291,292],{"class":98}," user.account.balance;\n",[74,294,296],{"class":76,"line":295},14,[74,297,169],{"class":98},[10,299,300],{},"Concrete adjustments for the review process:",[22,302,303,309,315,321],{},[25,304,305,308],{},[28,306,307],{},"Always check error handling paths:"," Every function that returns something can also fail. Is that accounted for?",[25,310,311,314],{},[28,312,313],{},"Verify domain fit:"," AI generates generic solutions. Does the code actually match the domain context of the system?",[25,316,317,320],{},[28,318,319],{},"Invert confidence:"," The more domain-specific the requirement, the more critical the review should be. Confidence in the output is not a quality signal.",[25,322,323,326],{},[28,324,325],{},"No accelerated approvals:"," AI-generated code requires at least the same review effort as code from experienced developers.",[14,328,330],{"id":329},"why-this-matters","Why This Matters",[10,332,333,334,339],{},"The review bar for AI-generated code must be higher than for senior developer output, not lower. Teams that relax their standards because \"the AI wrote it\" accumulate hidden technical debt faster than through any other cause. The speed that AI tools promise is not delivered through careless review, it is mortgaged. Structured handling of AI contributions, including clear review checklists and defined responsibilities, is part of an ",[335,336,338],"a",{"href":337},"\u002Fen\u002F#packages","AI Enablement"," programme that equips teams for sustainable results.",[341,342,343],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":69,"searchDepth":84,"depth":84,"links":345},[346,347,348],{"id":16,"depth":84,"text":17},{"id":58,"depth":84,"text":59},{"id":329,"depth":84,"text":330},"\u002Fimg\u002Fblog\u002Fki-coding-assistenten-cover.jpg","2026-03-24","AI-generated code looks correct but carries different risks than human-written code. Why the review process needs to be adapted.",false,"md",{},"\u002Fen\u002Fblog\u002Fki-generierten-code-richtig-reviewen",{"title":5,"description":351},"en\u002Fblog\u002Fki-generierten-code-richtig-reviewen",[359,360,361,362],"AI","Code Review","Software Quality","Engineering Leadership","QbfVZ1jpIylcIdXIGWsig69MiH3bNPKS40gvZaaJJv0",1780122462566]