HN
Today

How well do agents use test/verification techniques?

This technical deep-dive rigorously evaluates how well LLM agents apply various software testing and verification techniques, from TDD to formal methods, when tasked with implementing a Zstd library in Rust. The surprising finding is that explicit instructions often lead to worse outcomes, with agents struggling to use advanced tools effectively. It's a pragmatic, evidence-based look at a critical challenge in agentic coding, offering counter-intuitive results that resonate with developers grappling with LLM limitations.

9
Score
0
Comments
#4
Highest Rank
6h
on Front Page
First Seen
Sep 8, 4:00 AM
Last Seen
Sep 8, 9:00 AM
Rank Over Time
84891010

The Lowdown

This article investigates LLM agents' proficiency in applying various software testing and verification techniques. It evaluates 26 different conditions, including Test-Driven Development (TDD), formal methods, property-based testing, and fuzzing, by tasking agents to implement a Zstd compression library in Rust. The goal is to determine if explicit instructions to use specific techniques improve code correctness compared to default agent behavior.

  • The experiment involved 26 testing conditions and 4 "skills," testing agents (codex with GPT-5.6 Sol) on a Zstd implementation in Rust.
  • Overall, most specific testing instructions led to worse or no significant improvement compared to "Default" (no additional instructions).
  • Agents frequently misused or superficially applied advanced testing techniques (e.g., formal methods, property-based testing), often defaulting to standard unit tests.
  • Formal methods like Verus, Alloy, and Lean 4 were used for abstract or vacuous proofs, not for verifying actual code effectively.
  • Property-based testing (QuickCheck, Proptest, Hegel) was often reduced to simple smoke tests or random inputs that only hit error paths.
  • TDD caused agents to produce more tests and follow an iterative workflow, but often led to worse, overfit, or incorrect tests, underperforming as predicted.
  • Fuzzing, though often ineffective, occasionally found real bugs when agents stumbled upon generating structured random inputs.
  • "Skills" (pre-defined instructions/libraries for agents) generally underperformed, often increasing cost without improving correctness, sometimes due to their tutorial-like nature or large token size.
  • The author's custom "skill," designed to nudge agents away from common pitfalls, performed best but still had limitations, such as agents failing to use "fresh context" for independent verification.
  • A key takeaway is that agents struggle with effective testing, often identifying risky areas but failing to apply robust verification, suggesting a gap in their training or understanding of complex testing methodologies.

The findings suggest that simply instructing LLM agents to use specific, even advanced, testing techniques does not inherently lead to better code quality. Instead, agents often misuse these tools, highlighting a fundamental challenge in current agent capabilities and the need for more sophisticated guidance or training in effective software verification.