back

by groomlake·5d ago·view on hn ↗

  I don't know why you would run an agent loop without TDD? Should you write code without test coverage? So something must run the tests to be sufficient anyway?
You can have the agent write them after. The article is specifically about TDD, meaning writing a small test that will fail, making it pass, (refactoring), and repeating until the feature is finished.

  Was there a difference in cost?
The author claims TDD used 3x tokens, but points out it might not be 3x the cost due to caching. It's near the end of the article.
1 comments
A strict tests-must-be-written-ahead-of-time TDD advocate might say that writing the tests last is an error like p-hacking (choosing the threshold of statistical significance after the experiment) is an error.

Having always suspected that test-first TDD was most correct like adhering to the Scientific Method is most correct, I suspect that there are unmeasured differences between the results. But perhaps test-first TDD is a sham in AI and IRL