A passing test can confirm an expectation without discovering an unexpected failure. Adversarial thinking reverses the question: instead of asking whether code works on familiar inputs, ask what could make it fail. This matters for AI-generated code, where the developer’s examples and the generator’s implementation may share blind spots. section 8.4 section 8.4.6
Different techniques attack different assumptions:
- Property-based testing generates many inputs to challenge stated properties; fuzzing explores the input space with emphasis on unusual cases. section 8.4.6
- Mutation testing deliberately changes code to see whether tests detect the sabotage. Differential testing compares behavior with other implementations. section 8.4.6
- Adversarial review gives a different model the specification and diff, with instructions to find a breaking input rather than approve the change. A proposer and critic can also challenge each other before human review. section 1.5
Challenge a markup parser
A test that checks whether **bold** becomes <strong>bold</strong> verifies one expected example. Generating varied inputs can instead search for cases the example never anticipated. Even a thoroughly tested parser still needs system-level checks for data flow, API contracts, and end-to-end behavior. section 8.4 section 8.4.6
Use adversarial verification where code handles untrusted input or complex logic, and weigh its cost against the consequences of failure. It complements rather than replaces unit tests, integration tests, and other checks selected for system criticality. section 8.8.2
Independent AI review reduces shared blind spots but cannot eliminate them: models can inherit overlapping habits. The review loop should end with a human judging the consequential decisions, not with another model’s approval treated as proof. section 1.5

