Urgent.News

What's breaking now, across thousands of outlets.

AI

Free Tokens Are Better Spent Fuzzing Your Own Code Than Benchmarking Someone Else's

Three weeks ago I watched a colleague burn 40 minutes reading a vendor's benchmark report, then another 20 minutes explaining to the team why the numbers did not apply to our codebase. The same week, a two-line change in our config parser silently broke a date-format edge case that no test covered. The connection between those two events is the thesis of this post: free model tokens are better…

Three weeks ago, a colleague wasted 60 minutes reviewing a vendor's benchmark report and then spending another 20 minutes explaining to the team why those numbers were irrelevant to our codebase. That same week, a simple two-line change in our configuration parser silently broke a date format edge case that was not covered by any existing tests.

This post argues that free model tokens are more effectively used for generating adversarial inputs for your own code through fuzzing rather than running additional agent benchmarks. Benchmarks only confirm whether a model is better or worse than the previous version, while fuzzing uncovers unknown areas where your code may fail due to unforeseen inputs.

Free tokens allow for regular practice of bug discovery rather than just purchase decisions. Property-based testing is the technique where instead of writing individual input-output pairs, you define an invariant and let a generator create hundreds of inputs that must satisfy it. This approach has proven more effective than hand-written tests in discovering edge cases that were missed.

Coding agents excel at creating these property statements once you provide the invariant, and they are also proficient at generating the adversarial inputs. The main challenge is running enough tests without incurring per-execution costs, which the free token tier addresses. MonkeyCode is an open-source project offering a free tier with 10 million tokens and a free server, sufficient to run the property-test loop on a real repository.

The workflow involves writing the property, generating the test harness using the agent, and running the iterations until a counterexample is found or the budget is exhausted. A practical example using Python's Hypothesis library demonstrates how to turn a simple property into a full test suite for your code. The key is providing the invariant while the agent handles generating the generators.

With the free tier, the loop runs automatically. Invariant types that have proven effective in finding real bugs include round-trip (serialization and deserialization), idempotence (applying an operation twice yields the same result as applying it once), and ordering (sorting, filtering, and deduplication preserve business logic).

Each invariant type can catch significant bugs by writing a one-sentence property that the agent expands into hundreds of test cases. Teams should prioritize high-value rows in a decision table, focusing first on config parsers, serializers, formatters, and date/time and timezone logic where the failure space is large and unintuitive.

Pure business logic with clear invariants and UI rendering can also benefit, though visual verification remains challenging. Property fuzzing should complement, not replace, integration tests, security audits, or load testing. It excels at revealing specific classes of logic bugs that were missed by other testing methods. However, it may not be suitable for codebases without existing test suites, teams lacking expertise in stating clear invariants, or those operating critical security systems where fuzzing output should be treated as a starting point for manual review rather than a guarantee of correctness.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

The Runaway Diff: A Token-Budget Postmortem for Coding Agents

The task looked trivial on paper: add a rate limiter to a small Python service and update three call sites. I handed it to a coding agent running on MonkeyCode, an open-source project with free model…

  • Engineer assigned a token allowance for coding agent on MonkeyCode platform
  • Diff output was two-thousand lines for change that should have been forty lines
  • Fix was a simple Python script imposing token budget and detecting edit oscillation

More from Sunday 23 August →