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

> LLM compared to doing it manually.

When testing against an LLM you probably want to mock its responses for tests. Which is quite doable by copy-pasting its responses. I'm just curious what the "best" workflow is.



If I'd be using Clojure for this, it would look something like this:

1. Write a function that returns a LLM response

2. Play around with this function in a `comment` block, highlighting what I'm testing

3. If I find a response I'd like to "cement"/save and use for testing, Conjure (what I use to connect to the REPL) has a command that is basically "evaluate what's highlighted in the editor with whatever that returns when evaluated", so that basically copy-pastes the return value into the editor

4. Move it into a test somewhere

Not sure there is a better or faster workflow, from deciding "Hmm I want to test against this in the future" to "make test checks this" takes something like 2 minutes with a workflow like this.




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

Search: