4 ms·
> At 30 bugs per kLOC[...] Where does that number come from?
by DasIch 5y ago
> At 30 bugs per kLOC[...]
Where does that number come from?
- arthurcolle 5y agoThe context suggests to me that this was a self-reported approximation from GP
- ip26 5y agoIt’s a median-ish of various studies. You can google “bugs per 1000 lines of code”. The important part wasn’t the exact number, but rather the discovery that the ratio is pretty stable.
- marcosdumay 5y ago> but rather the discovery that the ratio is pretty stable The thing is, it isn't stable. It just doesn't depend on the language, what is very surprising. But it varies enormously from one study to another and, AFAIK, nobody has a good set of factors explaining it.
- fauigerzigerk 5y agoI don't find it that surprising. I think what programming languages (and styles) do is fill up each line of code with information until a roughly constant level of cognitive effort is required to process that line. At that constant level of effort, we make a certain constant number of mistakes. And that's what I think these studies show.
- marcosdumay 5y agoSome languages are very dense, others break things down in more lines. Some languages care about hard to control details of your computer's working, others handle that automatically. Some languages come with builtin validators, others let you write any kind of trash and try to make sense of it. Personally, I suspect the number of bugs per line is defined by social and psychological factors, and what changes from one language to the other is the amount of effort one has to put into testing and debugging. But well, none of this is obvious to me.