Dan Lu conducted an experiment evaluating how AI agents write code and tests for a Zstd decoder in a restricted environment. The study involved 26 conditions, using Codex with GPT-5.6 Sol, with 80 runs per condition. Agents were tasked with writing a decoder based on RFC specifications without internet access.

The experiment showed that agents often failed to detect bugs when test inputs were symmetric or identical, such as using palindromes to test string reversal or identical data streams for Huffman coding. In many cases, tests passed even when the implementation was incorrect because the chosen inputs masked the logic errors.

Differential testing attempts were largely ineffective, as agents often repeated the same algorithmic errors across multiple implementations. Furthermore, generating random bytes for fuzzing frequently resulted in early failures, while structured inputs were used in only 10 out of 160 runs, proving more successful at identifying bugs.

The author suggests that developers should explicitly define the specific error a test must catch, select inputs that expose that error, and verify the expected output against a contract. Mutation testing, where controlled changes are introduced to verify that tests fail appropriately, is recommended as a practical approach to ensure test sensitivity.