Lately I've been experimenting with using TDD approaches for LLM assisted coding. There is a little bit on YouTube and some research papers on this topic. But most of it relates to how well you understand the test suites for the given language / framework to ask for the tests to be designed in the right way.
This has been great in gpt-4o for python because it has a built in interpreter. So I can describe the way I want the API to look, ask it to write tests in Python, write the code to satisfy those tests, and then run the unit tests in it's own local python env to see if the code works.
This streamlines things a lot. I find I can get working artifacts from gpt this way when other I often have to have a bit of a back and forth where I'm the one testing and pasting in errors.
For gpt-4o this only works with python though (for now).
It might be interesting to build a platform like this, even in your local laptop that allows the LLM to shell out to a sandbox for something like React with the unit tests configured so the LLM can run them and get the output.
Interestingly, frameworks like react also have test suites around ui/ux concepts. I haven't tried it, but I think it would be interesting to use that same approach with those test frameworks to attempt to get better looking frontends (something the LLMs are not especially good at out of the box)