Or you could have the AI write test cases (writing them out is often the most laborious part) and then validate them by hand. That'd be little different than writing them yourself, though again edge cases may be missed. You just skip the un-fun part of repetitively typing out the code for each case.
Knowing what tests to write is another story.
My problem with AI generated tests is that they lead to over testing and it bogs you down once you have to do refactoring. Ideally detailed tests should come once you're on like 3rd iteration and really sure you've nailed the design (oh I hate TDD if it isn't obvious). With AI I'm getting detailed tests and first try implementations, bad code locked in everywere :(
More tests != better code, tests are still code - the less code you have to satisfy some goal the better.
From my experience, ChatGPT-3 has been pretty good at exercising all meaningful branches (I look at code coverage results, I don't care for percentages at all), in the least amount of tests, on the first go. I definitely have to modify each test quite a bit, because it frequently hallucinates API calls that don't exist, but the code that it produces is an incredible blueprint. And I haven't even attempted to use RCI yet: "improve your answer" or "your answer is wrong because..."; ChatGPT-4 is supposedly extremely adept at reflecting on its responses. I can only imagine where this will be in a few years.
I was about 6 months late to Copilot because I was incredibly skeptic about it, without having used it in anger. My skepticism was mostly (but not entirely) wrong. Having actually used ChatGPT in anger, I find the degree of skepticism extremely skeptical.
It's like picking up C in the 1970s. We're at the very beginning when things are pretty rough, but the skills that I am building today are going to be foundational in the future. If you're dismissing AI without giving it a few weeks to earn its keep, it's going to be rough to catch up when things improve to the point where it is required.
It isn't that stupid, and that was done at least a decade ago with static+control flow analysis. As for AI, I was recently writing tests for a VT push parser in Rust (which is novel code, so no parroting here) and it clearly knew enough about VT to write a, correctly, failing test. I had a bug in my parser, and the test that AI generated found it.
At the end of the day, I'm not sure why anyone would believe the critique of someone who hasn't used a tool in earnest.
That gets me checking the tests in the middle so I can fix them up if I need to.
I love coding. Enough that I don’t want to age into being a director/manager, etc.
But what is important to understand is that from the other direction the owners of business only care about profit - they don’t care abt your love for parts of your work, except when they can gaslight and use it to keep you working. For them.
Remember when Dwight Scrute got 13 “employee of the month” awards in a single year because he got 2 in February in lieu of a raise?
That’s what I mean.
AI will be used by owners to either gaslight your love into using it for them, or possible remove what you love to be replaced by AI.
Which, for the record, is not “intelligent” any more than anything else in code.
Anything implemented is either to gaslight our love for this industry for profit, or to replace parts for profit.
It is no surprise at all.
That's how doing manual search and replace instead of search/replace in editor or computing stuff in spreadsheet by hand instead of using formulas.
If you think AI's output is suboptimal, right. Maybe find a way to use/train AI better to produce good enough output. But simply wishing to out-robot a robot is pointless.
Think of the recent generative AI artwork...rather than drawing, and creating, (some/most?) artists fear just being prompt-carvers. The fun of the art has been replaced with menial labour of crafting prompts.
Someone can make a print generated by AI - and it will be beautiful I am sure.
So when someone wants a physical panting with impasto texture and painterly strokes… the “real” painters will for sure still make bank.
I mean - not me: I have only panted for 8 years and still “suck” - but I love it.
But Thomas McKnight will still paint his beautiful scenes and people will still buy them for what they are: art.
AI art is art. Meatspace art is art. Heck: I code for money. CODE is art. Software is art.
Fearful that a prompt carver can replace 10 artists is the more realistic fear here. That is the essential trajectory being plotted out by this technology and the trajectory described by the article.
Artsy types doing art using basic tools such as brushes will be the same as handicrafted assembly in programming. Rarely needed and not much people are hired to do so.
So far, copilot just shows me the happiest path options for everything I've tried, and really falls over when it's not something that "Well this API looks like API_functionCall, so your query for <get X> must look like API_getX". It rarely does.
Now with AI, they use tools to create a model - and then spend 2-3 days to update it.
This is a productivity improvement, but it also took away a key thing they loved about their job. There isn't really a solution here at all, and the poster wasn't looking for solutions either. Just venting.
We'll be seeing this more in the future, and I wouldn't be surprised if multiple people change careers over it.