News for hackers. Stuff that matters.
Re:The top bug predictor is not technical, it's organization... by ChrisMarshallNY on Wednesday December 18, 2019 @07:43AM (#21824223)
That makes sense. Every line is a potential bug.

But it's not the only factor, and, quite frequently, it's a matter of correlation, as opposed to causation.

That kind of thing can be very tricky to determine.

When I write software, my first stab at a function tends to be a fairly linear, high-LoC solution, which I then refactor in stages; reducing LoC each time, and ensuring that the quality level remains consistent, or improves.

As far as quality goes, my first, naive stab, was just fine, and I have actually introduced bugs during my refactoring reduction.

Re:The top bug predictor is not technical, it's organization... by the_af on Wednesday December 18, 2019 @08:08AM (#21824407)
Note that I'm not arguing about underlying reasons, just saying what the empirical results show. That's reality.

So if you try to predict software bugs using modularization (or lack thereof) or "if-then-else" branches, or whatever complexity metric you can think of, you'll get one result. If you try to predict them using simple line count, you'll get another result. The second one will have better precision & recall. So no metric so far has been shown to be better than simply counting lines. That's not an obvious result, but it's the truth.

Sadly, you'll have to believe me because I cannot find the studies right now.

Re:The top bug predictor is not technical, it's organization... by shantly on Wednesday December 18, 2019 @08:29AM (#21824566)
Any results/findings for development speed or new hire on-boarding?
Re:The top bug predictor is not technical, it's organization... by usrusr on Wednesday December 18, 2019 @08:53AM (#21824768)
> Every line is a potential bug.

But there are many code lines that don't contain bugs. If only one could somehow make software only from those...

I'd take a slightly more mathematical approach to the code lines predictor: zero lines of code contain zero bugs, an infinite amount of lines of code contains an infinite number of bugs. It follows immediately that yeah, LOC is massively important and no, we are not interested in that, what we do want to know is how everything else is influencing the derivative.

(and on that digression about longish linear solutions: I completely stopped feeling bad about writing long, linear functions for long, linear problems. I've come to greatly prefer those over the indirections of forced subdivision. If there's a reason to subdivide other than "long is bad", great, go for it, but never subdivide just for having smaller parts. Use assign-once, nested scope etc to make the length more palatable)

Re:The top bug predictor is not technical, it's organization... by hnick on Wednesday December 18, 2019 @06:22PM (#21830535)
Pretty sure when the tests are green you're just meant to reach for the next sticky note ;)