3 ms·
Not to mention, if you're able, you can paste in code to ChatGPT to give context and tell it to generate unit tests. I've found it does a generally good outline
by ohthatsnotright 3y ago
Not to mention, if you're able, you can paste in code to ChatGPT to give context and tell it to generate unit tests. I've found it does a generally good outline of code that annoys me to write, and then I can tweak the cases and add more as I need. Makes a chore I dislike much, much easier.
- JohnFen 3y agoBut writing my own unit tests and code outlines, as annoying as they are, make me a better programmer and let me produce better code. I can't tell you how many times the act of writing unit tests -- just writing them, not even running them -- has given me an important insight into the code that I would have missed otherwise. Using tools to do these things for me means that my skills and abilities will suffer.
- jimmaswell 3y agoI make great use copilot for test cases now. I still think through what I'm trying to do and start writing it, but as I go along copilot will tend to write what I had in mind anyway and complete 20 lines of the likes of `assertEquals("overriden address 1", model.getAddress1());` before I can blink. I'll also often enough be caught offguard by some strange output and realize it's because I did something wrong, so I catch the problem much sooner.