Skip to content

AI Didn't Ship Your Bug, Your LGTM Did

Naseebullah AhmadiSenior Software Engineer, London

One camp says AI is about to replace engineers. The other ships two hundred generated lines, with tests generated from the same code, on the strength of a Friday LGTM. Both treat the model as the one doing the job, but the model never pressed merge.

2 min read
#rant

Every week brings one of two posts: engineers have eighteen months left, or a production incident whose root cause, once you squint, is "the AI wrote it and it looked fine." I'm tired of both.

The doom take

"AI will replace engineers" assumes the job is typing, and typing was always the cheap part. The expensive part is knowing what to build, spotting the requirement that contradicts another one, and saying no to the feature that would page someone at 3am for two years. A model writes a function faster than I do. It isn't in the meeting where product explains what they meant, and it won't be the one asked "why did we build it this way?" six months later.

If your job really was tickets in, code out, no judgement in between, then yes, worry. That was a bad job before the models showed up.

The LGTM take

The other camp worries me more, because their code ships. Follow one change through:

  1. Prompt: 200 lines back to Tests generated from that code: skimmed
  2. Tests generated from that code to Friday LGTM: green, bug included
  3. Friday LGTM to Production: looks like the rest
Four hand-offs, and at no point did anyone check the code against what it was supposed to do.

The tests were written by reading the code, so they assert what it does, bug and all. The reviewer sees two hundred lines that look like the rest of the codebase. Nobody in that chain read the thing.

When it breaks, the retro says "AI-generated code". But the model didn't press merge. A person approved code they didn't understand, the same failure we had in 2015 when the code came from Stack Overflow.

What I actually do

  • Read every line before it's mine. If I can't explain a line in review, it doesn't go in, whoever or whatever wrote it.
  • Ask what could break it. On the hard parts I don't just ask the model to write it; I ask what would make it fail. That's where it's most useful.
  • Keep the boring checks. Types, lint, tests, review. They don't care where code came from, and they shouldn't.

The calmer version of this is AI Without Losing Judgment. The short version: use the tool, it's a very good one. Just stop blaming it for a merge button you pressed.