Live data from Hacker News

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

theregister.com

121–130 of 153 posts

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

#121
post #72

Earlier quoted context omitted.

The problem with ML is that it's pattern recognition, it's an approximation. Code is absolute, it's logic that is interpreted very literally and very exactly. This is what makes it so dangerous for coding; it creates code that's convincing to humans but with deviations that allow for all sorts of bugs. And the worst part is, since you didn't write the code, you may not have the skills (or time) to figure out if those…

Expand your view. AI can write tests, read error messages, find bugs in your code, we just need to give this task. Let's think about tests. You write a function, the AI writes a few tests for you. maybe you need to add a few more. But it's better to have tests, and you might have missed one of them. Error messages - we rely on error messages to make this leap from "code parrots" to "bug free". Most of our codes fail…

All those things are susceptible to the same issue: the ML model can generate test cases and error messages that are convincing to you and me regardless of whether they're actually right. Don't get me wrong, ML will reach a point someday where it catches up to humans in this respect; this is merely a shortcoming of today's ML, not tomorrow's, and it highlights where ML's weaknesses currently lie (in contrast to more vaguely defined goals like artwork).

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

#122
post #54

Earlier quoted context omitted.

Yes but I don’t see it as generating entire blocks of code you’re supposed to copy and paste into your project. It’s like a template, a suggestion from which you can build your own version. Only rarely does it have the context or understanding of the wider codebase to do a programmers job for them. The times when it does generate a copy/pastable function it’s usually some isolated utility function like “format date a…

I think that many people will treat it as something that can generate entire blocks of code. Unfortunately it can be quite broken even just writing basic functions. One of my tests was doing some quaternion rotations. It did them, but refused to stop multiplying by the conjugate afterwards. Another was converting dates to "years ago", which was broken for BCE because ChatGPT doesn't understand the underlying concept.

> I think that many people will treat it as something that can generate entire blocks of code. Unfortunately it can be quite broken even just

Have you tried to use it for this purpose?

It basically can’t unless you’re only building a toy app. Even after multiple levels of refinement it still requires tons of real programming work.

Which is largely my point, it won’t because it’s fundamentally incapable of providing that in its current state. Even without the buggy part it’s mostly just outputs generic stuff that will always need to be integrated into the wider codebase and to specifically what you’re trying to build.

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

#124

P¹ All people write buggy code. [1] P² AI assistants are trained on code written by people ∴ People using AI assistants will write buggy code [1] Some might object to this, either in their own case or that of some of their professional associates. I would not trust the judgement of these people.

I will object to P1: assumes facts not in evidence. And anyway there are two logical problems:

1. Not all people write code. 2. Code can be written without bugs.

It may be provable that a statistically significant amount of code written by people is buggy, by linking to any overview of CVEs.

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

#125
post #122

Earlier quoted context omitted.

I think that many people will treat it as something that can generate entire blocks of code. Unfortunately it can be quite broken even just writing basic functions. One of my tests was doing some quaternion rotations. It did them, but refused to stop multiplying by the conjugate afterwards. Another was converting dates to "years ago", which was broken for BCE because ChatGPT doesn't understand the underlying concept.

> I think that many people will treat it as something that can generate entire blocks of code. Unfortunately it can be quite broken even just Have you tried to use it for this purpose? It basically can’t unless you’re only building a toy app. Even after multiple levels of refinement it still requires tons of real programming work. Which is largely my point, it won’t because it’s fundamentally incapable of providing t…

I have, actually. Today I had it write a basic JS map for my wedding site. Yesterday I had it produce a puzzle solver with CLI and DSL. Obviously I'm still doing manual interventions at key points, but it's changed my personal cost/benefit calculation on whether various random ideas are worth doing.

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

#127
post #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 clas…

> 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.

For me the interesting question is not whether they can improve quality.

The interesting question is, given that they can be used to produce code faster (as a sort or auto complete on steroids), whether that improvement can be achieved in a way that doesn’t involve a decrease in quality.

I think it’s possible, for sufficiently competent professionals that can spot and correct mistakes on the fly, and I have anecdotal evidence to support the idea, but it would be nice to see serious research around it.

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

#128

> 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…

Many industry professionals ignore or are unaware of known attack vectors. Meanwhile, many schools do teach a semblance. Given how young and emotion-driven the field is, a sweeping statement like this is useless. If security is remotely concerning to you, get a security expert as your baseline.

> Many industry professionals ignore or are unaware of known attack vectors. Meanwhile, many schools do teach a semblance.

It’s not either or. Most industry professionals get there after going through school, or are at some point checked to have achieved equivalent knowledge somewhere else. A professional is school + experience.

Post reply on HN