Re:Ask HN: How are you feeling about software engineering in...
by ohthatsnotright on Tuesday June 27, 2023 @01:42PM
(#36496239)
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.
[ Parent
| on HN ]
Re:Ask HN: How are you feeling about software engineering in...
by JohnFen on Tuesday June 27, 2023 @01:52PM
(#36496345)
But 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.
Re:Ask HN: How are you feeling about software engineering in...
by jimmaswell on Tuesday June 27, 2023 @02:02PM
(#36496475)
I 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.