Live data from Hacker News

Study finds AI assistants help developers produce code likely to be buggy

theregister.com

21–30 of 153 posts

Re: Study finds AI assistants help developers produce code likely to be buggy

#21
Surprising. If only there were a way that we could have foreseen that an AI trained to write code in part by looking at people who, self-admittedly, don’t know how to write code, and people who write code for others with minimal context (Stack Overflow), would produce buggy code. It is a case of GIGO.

Most developers do not learn much from Stack Overflow. Why do we expect AI to fare better? In my experience, one in ten (optimistically) Stack Overflow answers give anything more than a code snippet with enough information to get the asker through their immediate issue. It can be beneficial if you have the necessary understanding already and only want the code snippet, but this is no way for humans or machines to learn.

Also, having an “AI Assistant” must lower programmers’ guards against buggy code. After all, it is an assistant - it must assist you, right? Subordinating humans to machines will not work in this domain until there is better training data and the machines can be taught the reason they are writing specific code. Until then, I have low hopes for AI-generated code.

Even if AI could generate correct, bug-free code the majority (say 99.9% of the time), I expect finding and correcting bugs will be difficult for humans. For example, how many bugs are found and corrected by the author of code during development, versus how many in peer review? I’m reminded of a saying akin to “ask someone to review 5,000 lines of code: no bugs. Ask someone to review 5 lines of code: 5 bugs”. We are poor critical reviewers, and AI cannot fix that. AI assistants probably worsen reviews, because reviewers will expect high-quality code from their AI assistants.

Re: Study finds AI assistants help developers produce code likely to be buggy

#22
post #12

I find the best use of coding AI is for shitty little inconsequential apps. I could imagine a startup founder using it to feel like they are saving a lot of money on engineering costs by using it for an MVP. You will likely never use coding AI for things like embedded systems, financial software, manufacturing, flight computers, operating systems, software for managing networked infrastructures, various domain specif…

That's my experience as well. I've tried Tabnine and Copilot and they're both useful as fancy line autocompleters when you know what you want to type. However they're unreliable to write code directly from business logic. They'll usually write code that _seems_ to be doing the right thing but with very subtle bugs because they don't understand the intent of the function and just try to mimic what's already there.

Re: Study finds AI assistants help developers produce code likely to be buggy

#23

> The study involved 47 people with varying levels of experience, including undergraduate students, graduate students, and industry professionals. Honestly, for things like catching potential sql injections, “industry professional” should be the start. I won’t trust a student of any kind further than I can throw them, for topics like maintainability, security or readable code. Those are too far away from what’s usual…

Having "industry professionals" in this sort of study actually puts it in the top tier of studies. Most studies don't even have that, they're all undergrad based.

(Sometimes people express frustration that we don't pay much attention to "the science" in the programming field, and my response is generally to tell such people to take a closer look at the "science" they're trying to wave around. Studies based on "a class full of juniors in college" top out at zero value, and it's really easy for them to be negative as they can be actively wrong about how the topic under study affects professionals.)

In this case, though, I'd submit that one doesn't need to run some sort of enormous study to establish the point that these code assistants are not a magic gateway to quality code at any experience level. I've been banging this drum on HN just from an understanding of how the tech works. Confabulation engines can't help but confabulate. You can't trust them. This GPT stuff is perhaps a better view into human psychology than a useful tool; we've never built an AI that so strongly emits signals of confidence before. They're the best artificial confidence game players ever.

Re: Study finds AI assistants help developers produce code likely to be buggy

#24
post #4

I made a site using the OpenAI APIs new models (similar to ChatGPT) for creating simple apps or demos using natural language: https://aidev.codes . If anyone is interested please try it out. I tried to promote the site by submitting to HN and did not receive a single vote. I feel that although many people may not be impressed, it is better than 0. So I am just trying to promote it in related threads. Anyway if you ha…

What are users supposed to do when they visit your site? Sign up? There's not enough information there on what to expect from the product for me to want to sign up. You should add more detailed information about what the tool does as enticement to try it.

Re: Study finds AI assistants help developers produce code likely to be buggy

#26
post #20

Earlier quoted context omitted.

Your website is only 30 words with no examples or explanations that I can see – just a sign up. The video on your site doesn’t play on my computer. It might be worth 1,000 votes, but it’s hard to know without actually seeing what it can do.

Thanks for explaining. What kind of computer? Yesterday I added another source to the video (mp4) in case people can't play WebM. Unless it is trying to play the WebM and doesn't like the encoding. I definitely need to link to the Discord with the examples and/or finish the Explore/featured page which is the main plan for that.

Video doesn’t play on iPad. Think about what audience you’re trying to attract and create a landing page that would resonate with them…

Re: Study finds AI assistants help developers produce code likely to be buggy

#28
post #12

I find the best use of coding AI is for shitty little inconsequential apps. I could imagine a startup founder using it to feel like they are saving a lot of money on engineering costs by using it for an MVP. You will likely never use coding AI for things like embedded systems, financial software, manufacturing, flight computers, operating systems, software for managing networked infrastructures, various domain specif…

Agreed 100%. Implementing the correct algorithm/business logic is more important than spitting out junk that you don't really understand or won't pass code review.

The act of writing code is probably the easiest part of my job and I still haven't really seen these tools excel at that outside of toy examples.

On the other hand, I am pretty excited for AI code tools that me why my code is shitty beyond static analysis, linters, etc.

Re: Study finds AI assistants help developers produce code likely to be buggy

#29
post #20

Earlier quoted context omitted.

Thanks for explaining. What kind of computer? Yesterday I added another source to the video (mp4) in case people can't play WebM. Unless it is trying to play the WebM and doesn't like the encoding. I definitely need to link to the Discord with the examples and/or finish the Explore/featured page which is the main plan for that.

Video doesn’t play on iPad. Think about what audience you’re trying to attract and create a landing page that would resonate with them…

Thank you for telling me it doesn't play on an iPad. Your implication that the landing page is useless does not make sense in the context that the video does not play.

I do not own any Apple products and so was not able to test on them.

Re: Study finds AI assistants help developers produce code likely to be buggy

#30

> The study involved 47 people with varying levels of experience, including undergraduate students, graduate students, and industry professionals. Honestly, for things like catching potential sql injections, “industry professional” should be the start. I won’t trust a student of any kind further than I can throw them, for topics like maintainability, security or readable code. Those are too far away from what’s usual…

Even then, be skeptical. The software industry provides positive pressure to improve one's skills, but doesn't provide much if any negative pressure against lacking competence or willingness to learn. If developers want to, they can pretty easily skate by without developing talent, besides when their framework of choice becomes defunct.

This is true for a lot of low-brow work because companies simply need people to grind through requirements for their bespoke CRUD apps and integrations. There's still a boat load of that kind of work to be done, but it's only a fraction of the work available.

There are plenty of places where that negative pressure exists though and there's higher standards of quality. I doubt anyone is skating by with hacky code in aviation or space, for instance. So what you're talking about isn't really an issue where it matters.

Post reply on HN