5 ms·
One thing that I don't get from the article is if it can really catch my logical bugs. And I'm not trying to bring this research down because I don't doubt the
by lopatin 11y ago
One thing that I don't get from the article is if it can really catch my logical bugs. And I'm not trying to bring this research down because I don't doubt the results, but I am curious, and a bit skeptical, if this is a true step forward in catching "real" bugs or just surface ones. Even a sophisticated algorithm such as this. It takes into account features such variable scope and the operations performed on them, and is trained by real examples of bug patches on open source projects. Can it really understand my project? Because my logical bugs are specific to my project. It kind of reminds me of a recommendation IntelliJ once gave me for the following code:
return {left: am.left, top: am.right};
"WARNING: 'right' should probably not be assigned to 'top'"
This sounds like the kind of conclusion that such an algorithm might come to after seeing enough examples of similar bugs. It turns out that my code in this situation is actually correct, but in order to know this, you would have to have a thorough understanding of the rest of the program.
- xyzzy123 11y agoOf course it can't catch your logical bugs. Please see my comment below.
- lopatin 11y agoI read it and it's a great overview of the different kinds of bugs that happen in the real world. Certainly more examples than the article provided. But your comment seems to be focused more about how a good language with a proper type system can prevent bugs from happening in the first place which is a definitely a good point but not what this article was getting at I think.
- euyyn 11y agoI'm not sure what's your question. If I review that piece of code, I think there's probably a bug. The same one IntelliJ noticed. If it's not a bug, it deserves at least a comment on top. But if to know it's not a bug I need to have "a thorough understanding of the rest of the program", then the function where it is is probably unreadable. In which case IntelliJ's warning is making your code better.
- lopatin 11y agoUh ok let's say "a thorough understanding of the rest of the function" instead. Does my question make more sense? The reviewer (human or computer) needs to follow the logic of the function, understand the true purpose of the function, in order to know that the line which looks like a bug actually isn't one. I feel that most of my bugs are domain specific logic bugs. My original comment wasn't so much of a question but skepticism that such an algorithm can catch the hardest bugs, despite the improved metrics compared to other algorithms.