4 ms·
Another major bug caused by copy+paste. I seem to remember a security researcher article months (years?) ago that identified this theme, showed a way to grep a
by skolsuper 10y ago
Another major bug caused by copy+paste. I seem to remember a security researcher article months (years?) ago that identified this theme, showed a way to grep a codebase for likely c+p errors and found a load of bugs in real production code that had remained hidden for years. I think I landed there from HN, but my google-fu is failing me now, can anyone else remember it?
- yorwba 10y agoProbably not what you mean, but this (https://news.ycombinator.com/item?id=12853211 https://news.ycombinator.com/item?id=12853211) submission about the PVS-Studio static analyzer also shows a bunch of copy+paste errors being found.
- wuschel 10y agoInteresting. How would you minimize these type of errors by design or best practice? I guess languages with a lack of higher order abstractions and no strong type system might be more prone to this type of errors.
- daira 10y agoThis isn't a subtle or difficult-to-find case. It's a case of "why the heck would anyone write code like that, in any language, in the first place?" The only language-level abstraction needed to avoid this particular kind of duplicated code, is a loop.
- stevenroose 10y agoI want to know..
- skolsuper 10y agoI went looking for this again today. It's not the article I was talking about, but you might find this interesting: http://pages.cs.wisc.edu/~shanlu/paper/TSE-CPMiner.pdf http://pages.cs.wisc.edu/~shanlu/paper/TSE-CPMiner.pdf