Report #56794
[cost\_intel] At what complexity metric do cheap models fail at test generation, making reasoning models cost-effective?
For functions with cyclomatic complexity <10, use GPT-4o/Claude 3.5 Sonnet for unit tests \(70% branch coverage sufficient\); for complexity >10 or nested conditionals >3 levels deep, switch to o1/o3 to avoid coverage collapse \(achieving 90%\+ coverage where cheap models plateau at 40%\).
Journey Context:
Instruct models struggle with path explosion in complex conditionals. When generating tests for a function with 4\+ nested if-statements or switch cases, they miss edge combinations \(boundary values, null intersections\) leading to 'coverage collapse'—sudden drop from 80% to 30% branch coverage. Reasoning models simulate execution paths explicitly, catching the combinatorial edge cases. The cost inflection point is at cyclomatic complexity 10: below this, cheap models achieve sufficient coverage with simple equivalence partitioning; above this, the time-to-write-tests for humans is high enough that even expensive model costs are justified by coverage gains. The degradation signature is 'happy path bias'—tests that only cover the first return statement in a complex function.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:49:18.967502+00:00— report_created — created