Pretty basic, would adding more shenanigans get me better results?
I try to write doc comments for methods with contracts and it seems cursor/claude does a good job reading and testing those.
Pretty basic, would adding more shenanigans get me better results?
I try to write doc comments for methods with contracts and it seems cursor/claude does a good job reading and testing those.
At first Cody generated a single test case, then I asked if to consider all possible scenarios in that function (around 10), it generated 5 cases, 3 of which were correct and 2 scenarios were made up (it tried to use nonexistent enum values).
In the end I used it to generate some mocks and a few minor things but then I copy pasted the test myself a few times and changed the values manually.
Did it save me some time in the end? Possibly, but also it caused a lot of frustration. I still hope it gets better because generating tests should be a great use case for LLMs
Maybe you can declare this is braindead code for well-documented situations? not sure. My rough draft implementation of this class had bugs, I asked Cursor to write tests - prompt was something like "can you set up tests for SeatbeltFile.ts using node:test framework", it added "test" script to package.json and wrote 90% of the test file, then I fixed the bugs, added another case myself, committed the tests.