8 Evaluation is king: how to trust code you didn’t write
This chapter covers
- The trust deficit in AI-generated code
- Why AI code needs different evaluation than human code
- The hierarchy of confidence
- Practical techniques at each level
- The shift from code author to trust engineer
There's an old joke in software engineering: "It works on my machine."
For decades, this phrase captured the gap between development and production, the constant tension between "I tested it" and "it actually works." AI-assisted development has made this joke obsolete - not because we solved the problem, but because we made it worse.
Now the phrase is: "The AI said it works."
When a human writes code, there's an implicit contract. The author has a mental model of what the code should do, and that model - however flawed - provides a baseline for verification. You can ask the author: "What were you thinking here? What happens if the input is null? Why did you choose this approach?" The answers may be wrong, but they exist. There's a mind behind the code that can be interrogated.
AI-generated code has no such mind. It has patterns, probabilities, and statistically likely completions. When Claude or GPT produces a function, it's not "thinking" about edge cases - it's producing tokens that are likely to follow previous tokens. The code may be correct and even be elegant, but there's no intent behind it, no world model you can probe, no author you can ask "what did you mean here?"