3 ms·
The most reliable place to find new bugs and security holes is next to others you just found out about. Bugs come in bunches. If you have fixed just one or two
by ncmncm 5y ago
The most reliable place to find new bugs and security holes is next to others you just found out about.
Bugs come in bunches. If you have fixed just one or two, more lurk right there. And, anyplace else that coder worked. The more you have found, the more remain to be found. Look at other places that coder worked that week. Or year.
- post-it 5y agoYour implication that specific bad coders are responsible for bugs is dangerous. Anyone can write a bug, and thinking that you're too good to do it is cocky.
- ncmncm 5y agoEvery bug is coded by a specific coder. We know there are huge differences in productivity of different coders. We know they repeat mistakes. Thus, the best place to look for another bug is in other code the same one wrote. But looking in your own code is probably next best. Ask yourself: if there is a bug somewhere in my code, where would it be? You may be surprised at how immediately the answer comes to mind. Look there.
- kevingadd 5y agoYes, but when a coder makes a specific mistake, it's likely they made it elsewhere. Similarly, when their mistake made it past code review, it likely made it past review elsewhere. They're not the only person making that mistake, but their diffs are a great place to start looking. A big subset of mistakes people make when writing software are the result of people not having the same understanding of a concept, policy or practice.
- extheat 5y agoIt really depends on the subject area of the code in specific. “Mistake” is a very broad term, in most cases when it’s used it’s not the implication that the writer didn’t know what they were doing, rather they wrote erroneous code—which ultimately everyone does at some point. What it is however indicative of, is a lack of thorough testing and review that could have potentially caught the error. Obscure errors in places such as parsers, rendering logic, complex algorithms, memory management, etc. are particularly tough areas because building a good exhaustive testing workflow can be a challenge. Even a good writer will make mistakes, otherwise we wouldn’t need proofreaders.