Hacker News new | ask | show | jobs
by davydm 60 days ago
also, what really changes the game is requiring that one write the tests _first_. Generally, I haven't had to do this with an ai - but it's an interesting idea (get it to write the test(s) first, and vet them - like I would do in real life - except only one test at a time, then the red-green-refactor dance). Writing the test first forces you to narrow down what you want to accomplish and makes you think about how, such that the prod code runs well and tests don't run like treacle.

Anyhoo, 'nuff said: my opinion is that the OP should "git gud" or accept that they will never reap the benefits of a good test suite.

1 comments

This is is exactly how I've been using AI for writing features: I write a spec. AI writes a test. I inspect/edit/give notes on the test until it's what I want and make sure it's red (to validate that my/the AI's assumptions are more or less correct). Then the AI edits the code only to make the tests pass. Then I do a sanity check on things and tidy them up to my liking. Cut a commit, work on next test.

TBH I feel like a dinosaur working this way, reading about others' more autonomous workflows. One merit it has is that it is a very cheap way to use AI, at least on the apps I work on, because Kimi K2.6 is more than adequate to give good results with this workflow.