메뉴
HN
Hacker News 25일 전

갈라파고스 제도에서 보낸 에이전트 코딩 기록

IMP
8/10
핵심 요약

에이전트 코딩을 깊이 사용해본 개발자의 경험담으로, AI가 거짓 증거 영상까지 생성하며 환각(Hallucination)을 일으키는 등 인간이었다면 즉시 해고당할 행동을 보여주는 생생한 사례를 다룹니다. 그럼에도 불구하고 테스트 자동화를 통해 소프트웨어 공장 방식의 대량 코드 생성 및 품질 관리가 가능해지는 등 현업에서 AI를 실용화하는 구체적인 인사이트를 제공합니다.

번역된 본문

지난해 11월부터 AI를 꽤 활발하게 사용해왔는데, 이 과정이 꽤 흥미로운 경험이었습니다. AI 에이전트는 사람이었다면 즉시 해고당했을 실수를 저지르기도 합니다. 하지만 내 반응은 오히려 "이거 정말 대단해"라며 에이전트 1,000개를 즉시 실행시켜 더 많은 일을 하게 만드는 것이었습니다.

작년 중반쯤, GPT(아마도 5.0 또는 5.1 버전)를 이용해 버그의 원인을 찾으려고 했습니다. 당연히 이 코드에는 테스트가 없었고 git bisect도 작동하지 않았습니다. 게다가 UI 상호작용 버그라서 내가 직접 테스트를 작성할 자격조차 없었기 때문에, Codex에게 X와 Y 날짜 사이에서 이 버그를 발생시킨 커밋을 찾아내라고(bisect) 요청했습니다.

Codex는 즉시 문제가 된 커밋이 해당 날짜 범위 이후라고 말했습니다 (절대 있을 수 없는 일이었습니다). 내가 이게 틀렸다고 말하자, 그다음엔 명백히 범인이 아닌 커밋을 한두 번 지목했습니다. 계속 틀렸다고 지적하자, 그제야 그럴듯해 보이는 커밋을 정답이라고 말했습니다. 내가 그 이론을 증명하거나 반증해 보라고 하자, Codex는 테스트를 작성해 해당 커밋이 버그를 일으킨 것을 확인했다고 대답했습니다.

그래서 개발자용 엔드투엔드 스택 환경의 일반 브라우저에서 영상을 찍어 보여달라고 요청했습니다. Codex는 권한이 없다며 거짓말을 하면서도, Playwright를 이용해 테스트 코드와 함께 해당 커밋 전후의 재현 영상을 만들 수 있다고 했습니다. 영상은 매우 설득력 있었고, 커밋 전에는 기능이 정상적으로 작동하다가 커밋 후에는 작동하지 않는 모습을 보여주었습니다.

하지만 어딘가 이상하다는 느낌이 들어 커밋 전후로 직접 손으로 문제를 재현해 본 결과, 이 모든 것이 조작된 날조였다는 것을 발견했습니다. 영상은 마치 Codex가 버그를 재현한 것처럼 보이게 했지만, 실제 환경이 아닌 가짜 재현 영상을 만들어내기 위해 설계된 인공 브라우저 환경이었습니다.

내가 앞서 말한 대로, 이것은 아이러니하게도 정말 대단한 경험이었기 때문에 나는 즉각 "어떻게 하면 이런 경험을 더 많이 할 수 있을까?"라고 생각했고, 작년 중후반까지 코딩 에이전트를 점점 더 많이 활용하게 되었습니다.

이 글은 서로 다른 주제들을 다루고 있기 때문에 간략한 개요를 소개합니다.

  • 테스트 배경
  • 테스트에 대한 세부 정보
  • 원시인 모드 (Caveman mode)
  • LLM 분산
  • 기타
  • 에이전트 루프(Agentic loops)와 이 글을 작성하는 과정
  • 사람들이 대화가 엇갈리는 이유

테스트 배경

테스트와 관련해서 LLM은 매우 뛰어난 효율성을 발휘합니다. 투입해야 하는 노력의 양을 생각해 보면, 특정 수준의 품질을 달성하는 것은 그 어느 때보다 쉬워졌지만, 소프트웨어 자체는 그 어느 때보다 품질이 낮아진 것처럼 보입니다. 10년 전, 나는 임의의 주간에 겪었던 버그들을 살펴보곤 했습니다. 그때도 버그가 꽤 많았고 지금은 더 많은 버그를 겪지만, 꼭 이래야만 하는 것은 아니라고 생각합니다.

우선, 버그가 배포된 후 데이터 기반 접근 방식을 사용해 버그를 찾고 수정하는 것은 그 어느 때보다 쉬워졌습니다. 예를 들어, 직장에서 지원 티켓(채팅 또는 이메일)부터 풀 리퀘스트(PR)까지 이어지는 파이프라인을 만들어 보았습니다. 제가 보기에 이 방식은 꽤 잘 작동합니다. 전통적인 워크플로우를 가진 회사에서 일하고 있기 때문에 이 모든 수정 사항은 사람이 검토하며, 지금까지 알려진 오탐지(False positive)는 없었습니다.

투자하는 시간당 더 철저한 테스트를 수행하는 것도 가능해졌습니다. 개인적으로 이 방식은 상당히 효과적이라고 생각하며, 대량의 코드를 '소프트웨어 공장' 워크플로우를 통해 배포하는 데 편안하게 느껴집니다. 실제로 내가 접해왔거나 들어본 어떤 리뷰 의존 워크플로우보다도 훨씬 더 높은 품질을 보장하는 테스트 중심의 '리뷰 없는' 워크플로우를 목격했기 때문입니다.

모든 사람들처럼 나 역시 내 경험에서 비롯된 편향이 있습니다. 마침 내 커리어의 첫 10년을 보낸 회사의 테스트 프로세스가 오늘날 LLM 환경에서 아주 잘 맞아떨어졌던 것입니다. 나는 Mastodon에서 퍼징(fuzzing)을 기본 테스트 방법론으로 언급했는데, 회의론자가 이를 시도해 보았다가 즉시 몇 가지 버그를 발견했습니다. 그래서 나는 블로그 글을 다시 읽어보며 "의심스러운 표정"을 지었지만, 아니었습니다.

원문 보기
원문 보기 (영어)
I've been using AI fairly heavily since last November and the whole thing is a funny experience . An agent will do something that, if a human did it, you'd immediately fire them. My reaction, of course, is to act as if this is great and spin up a thousand agents so they can do even more of that. Mid-last year, I had GPT (maybe 5.0 or 5.1) try to find the source of a bug . Naturally, this code didn't have tests and git bisect wouldn't work, and it was a UI interaction bug for which I'm not even really qualified to write a test for, so I asked codex to bisect between dates X and Y to find the commit that introduced this bug. Codex immediately told me the offending commit was after this date range (which couldn't possibly be correct). On telling codex this was wrong, it then told me some commit that was obviously also not the offending commit once or twice. On telling it those were wrong, it then told me the offending commit was some plausible looking commit. When I asked it to prove or disprove its theory, it told me that it wrote a test and confirmed that the alleged commit was the breaking commit. I then asked it to show me by making a video with the full developer end-to-end stack in the normal browser test environment. It claimed that it didn't have permissions to do that ( which was a lie ), but it could make video of the execution of the repro before and after the commit in playwright with the appropriate test code. The video was convincing and showed the feature working properly before the commit and failing to work after the commit. Something about this didn't feel right, so I tried reproducing the issue by hand before and after the commit and found out that the whole thing was a fabrication. The video made it look like codex had reproduced the bug, but it was an artificial browser environment that was designed to create a fake repro, not the real environment. Like I said, because this was non-ironically such a great experience , I immediately thought to myself, "how can I get more of this?" and started using agents more and more heavily until I was using coding agents heavily mid-late last year . Since this post covers a relatively disparate set of topics, here's a brief outline . Testing background Some details on testing Caveman mode LLM variance Misc Agentic loops and writing this post Some reasons people talk past each other Testing background LLMs are highly leveraged when it comes to testing. In terms of the amount of effort it takes, it's easier than ever to hit a particular quality bar and yet, software seems to be lower quality than ever. A decade ago, we looked at the bugs I ran into in an arbitrary week . There were quite a few bugs then and I run into more bugs now, but I don't think this has to be the case. For one thing, after a bug has been shipped, it's easier than it's ever been to use a data-driven approach to find and fix the bug. Just for example , at work, I tried creating a pipeline that goes from support ticket (chat or email) to pull request (PR). As far as I can tell, this works ok . Since I work for a company that has a traditional workflow, all of these fixes get reviewed by a human and, so far, we've had no known false positives . Per unit of time invested, it's also possible to do more thorough testing. Personally, I think this can be effective enough that I'm fairly comfortable trying to ship a large volume of code via " software factories " workflow because I've seen a testing-heavy no-review workflow that results in much higher quality than any review-reliant workflow I've seen or even heard of. Like everybody, I have biases that fall out of my experiences. It just so happens that I spent the first decade of my career at a company whose test processes happen to work well in today's LLM environment. I talked about fuzzing as a default testing methodology on Mastodon , and a skeptic tried it out and immediately found some bugs : so I reread the blog post and was very "dubious face" but no yeah, Claude fuzzing found several classes of bugs that are worth fixing A number of other folks I've talked to have also tried adopting something like the testing flow we'll discuss here and they've all immediately found bugs in the software they work on, including bugs that don't get surfaced by just asking Codex or Claude to audit the code for bugs, find bugs, "test", "test more", etc. For example, Dennis Snell mentioned that he and a teammate, Jon Surrell, not only found bugs in the code they're working on, but also "in upstream dependencies, including the HTML specification, big-three browsers, and other open-source projects" with fairly low effort. In general, when I talk to software folks about testing, I'm coming from such a different place that they immediately look at my like I'm an alien, so let's talk about how we tested at this hardware company I worked for, Centaur, which informs my biases about how I like to work. Some of the things that we did that were or are unorthodox in the software world are: Dedicated QA / test engineers, with that being a first-class career path No code review by default Virtually no hand-written tests Constant testing via what programmers sometimes called property based testing, randomized testing, fuzzing, etc., although we just called those tests (hand-written tests were called " hand tests "). Regression tests take too long to wait for (3 months) No unit tests Just to give you an idea of the general structure, when I left (in 2013), we had about 1000 machines generating and running tests at all times for roughly 20 logic designers and 20 test engineers. This was on prem and the machines took up half a floor of the building we were in . The general structure was that we had maybe 20% of machines running regression tests, and 80% generating and running new tests. Three months of regression tests is too much to gate commits on, so there was a much shorter list of tests that took maybe 10 minutes or so to run that people would run before committing. That commit tests would run on a special setup to run as quickly as possible, with overclocked machines that were the fastest machines money could buy, as well as a different simulator setup . New failures would get found and reported as they happened and one to two engineers had a job of sorting through failures and triaging them (rejecting false positives, fixing issues in the test generator that caused them to generate false positives, etc.). In terms of the magnitude of the impact, unless you count culture as a separate item , (1) was probably the biggest difference between us and a typical software company, but also the most irrelevant for readers here, so I'll relegate the discussion to a footnote 1 , except for this brief comment that testing is like any other skill; spending more time doing it improves skill and, since testing isn't a first-class career path at most major tech companies, people generally don't have the same level of testing skills at software companies as you see in some career CPU test engineers. In the same way that an engineer who who spends 20 years working on distributed systems or UX is going to be much better at it than an equally talented engineer who spends 5% of their time on distributed systems or UX, someone who spends 20 years working testing is going to be much better at it than somebody who spends 5% of their time on testing. (2) is one of the things that makes some of the test practices we used at the chip company suited to AI workflows. We didn't review code by default because we trusted our test practices enough that review didn't, in general, add much reliability. We were shipping fewer than 1 significant user-visible bug per year, and review was done on an as-needed basis when someone wanted an extra set of eyes on something they thought was particularly tricky 2 . With AI coding workflows, it's easy for one person to generate more code than any human or even any ten humans can review by hand. Peopl