What One Iteration Costs
Description and use
A defined and automated approach to measuring the cost of a single code iteration tracks tests-to-code ratio and average file size, enabling early defect detection and growth control.
Problem
Estimating the time and token cost of a single code iteration in a PHP monolith migrating to Go services.
Outcome
Clear, repeatable measurement of iteration cost enabled early warning of quality regressions and informed consolidation releases, improving code-test balance and growth strategy.
Workflow
- Define iteration unit as executor work on one iteration
- Exclude prompt writing, review, CI wait, and generated code from metrics
- Run scripted commands to count code lines, test lines, files, packages
- Generate tag-to-tag table automatically on each new tag
- Monitor tests-to-code ratio and average file size as quality gates
- Use metrics to validate consolidation releases and growth patterns
Evidence
An estimate is the working time of one background executor on one iteration: editing the named files, moving and extending the tests, running them until green.
The tests-to-code ratio is the row I actually watch.
The document is regenerated on every new tag and on the close of any large prompt set.
- Record date: 2026-09-16T02:45:28.369Z