Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think AI code generation will really amplify the importance of unit tests. If you can enumerate all the corner cases using tests then tell the AI to write code that does XYZ and passes the given tests, that's very powerful.


True, and honestly, if it turns out I can write unit tests all day I'll actually be a happy camper, I love thinking through problems and trying to account for issues, but I can guess how we will be encouraged to generate the unit tests in this new paradigm.


I’d prompt the AI to write the unit tests too. I know what the corner cases are. It doesn’t (yet).


Is there a way to give ChatGPT a test suite and ask it for code that passes the suite?


Not as part of ChatGPT, you need to write/use a tool that takes a test and a prompt and re-runs the prompt until the output passes the test.


Sounds like someone should corner that market ASAP.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: