I’ve had a lot of success in making it do test-driven development for me.
I first make it propose which tests I need for the functionality. Then I make it write all the appropriate tests, and then I get it to write the function. Then I tell it which tests fail and get it to debug.
Usually I would get lazy and write just a few tests. I’ve had it write dozens that I would never spend the time to write myself.
I really believe code quality and test coverage is far better than I could get in my own.