What One Iteration Costs
说明与用途
通过定义并自动化测量单次代码迭代成本,跟踪测试与代码比例及平均文件大小,实现早期缺陷检测和项目增长控制。
问题
Estimating the time and token cost of a single code iteration in a PHP monolith migrating to Go services.
结果
Clear, repeatable measurement of iteration cost enabled early warning of quality regressions and informed consolidation releases, improving code-test balance and growth strategy.
工作流
- 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
证据
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.
- 记录日期: 2026-09-16T02:45:28.369Z