News for hackers. Stuff that matters.
Re:The top bug predictor is not technical, it's organization... by iainmerrick on Wednesday December 18, 2019 @08:02AM (#21824368)
A single person can make an hugely complex piece of software, and a relatively large team can make a conceptually simple system.

In practice I think you tend to hit Conway’s law -- organizations build software that mirrors their own organizational structure. So it’s hard for large teams to make simple designs.

I’m very skeptical about that line count metric; in my observation bugs tend to sit between modules due to bad interface design. But I could certainly believe that bad modularisation is correlated with line count (in the form of excessive boilerplate).

Re:The top bug predictor is not technical, it's organization... by the_af on Wednesday December 18, 2019 @08:05AM (#21824389)
You can be skeptical, but this has been tested empirically. Defect density per lines is relatively constant (this is a well-known empirical result, which you can also google), which means more lines predict more bugs. When researchers contrasted line count vs bad modularization, line count was the better predictor (precision & recall).

Maybe it's anti-intuitive, but it's what reality shows :)

Re:The top bug predictor is not technical, it's organization... by vanderZwan on Wednesday December 18, 2019 @08:50AM (#21824743)
Maybe it's something as banal as there being a high enough chance of mistakes per LOC that this factor ends up dominating the other factors.
Re:The top bug predictor is not technical, it's organization... by the_af on Wednesday December 18, 2019 @08:58AM (#21824830)
Maybe. The key takeaway of this for me is: if you want to introduce a bug-predicting metric, you must do better than simple LOC count. If you can't do better, then ditch your metric :)
Re:The top bug predictor is not technical, it's organization... by MontyCarloHall on Wednesday December 18, 2019 @09:06AM (#21824904)
>if you want to introduce a bug-predicting metric, you must do better than simple LOC count

Agreed. As I pointed out in another post[0], a good candidate for this metric is the amount of unnecessary code, which is often a proxy for unnecessarily large/complex teams.

[0] https://news.ycombinator.com/item?id=21824110

Re:The top bug predictor is not technical, it's organization... by lallysingh on Wednesday December 18, 2019 @10:08AM (#21825557)
There's also just reading/remembering costs per LOC that make it harder to track specifics about APIs and your own code.

Smaller code fits in your head better, and stays more predictable. You don't have as many weird if-conditions to remember.

Re:The top bug predictor is not technical, it's organization... by iainmerrick on Wednesday December 18, 2019 @01:01PM (#21827454)
You don't have as many weird if-conditions to remember.

More LOC doesn’t necessarily mean more if-conditions, though! For code written in different styles.

It’s a strong statement that LOC and LOC alone is the best known predictor of bug rate, but that seems to be what several people in this thread are saying.

For example, I think most people (though not all) would agree that very dense code full of tricky one-liners (think Perl Golf) is more likely to be buggy and hard to maintain. But if so, “number of control structures used” or some such ought to be a better metric than plain LOC (I assume we’re using “LOC” literally here, not as a shorthand for something else).

Maybe there’s some second-order effect going on? Like very dense code discouraging modifications, so it gets less maintenance, and therefore accrues fewer bugs over time?

This is an interesting topic! Any research links appreciated.

Re:The top bug predictor is not technical, it's organization... by iainmerrick on Wednesday December 18, 2019 @12:52PM (#21827364)
You can be skeptical, but this has been tested empirically.

Yeah, I wasn’t claiming to be right, more noting my reaction! I’ll look up the research -- any links appreciated.

Re:The top bug predictor is not technical, it's organization... by 0x445442 on Wednesday December 18, 2019 @10:08AM (#21825573)
> in my observation bugs tend to sit between modules due to bad interface design

Yep, and when you start ripping the monolith apart into separate version controlled projects and deployment pipelines without addressing the interface issues you've significantly increased the complexity of your work products.

Re:The top bug predictor is not technical, it's organization... by matwood on Wednesday December 18, 2019 @11:39AM (#21826612)
Keep in mind that size doesn't necessarily equal complex. Where I have seen Conways law most clearly is with dysfunctional teams regardless of size.

I was on a team once where one of the senior people was such a jerk no one wanted to work with him. This led to him and the team carving out a piece of the system that he alone worked on and interfaced with the rest of the system through a single queue. This was certainly not the best design and added all sorts of unnecessary complexity.

Another team I was on had a person who was a good programmer and tended to blow off design meetings. The organization never rarely reprimanded this person. In turn it led to various APIs being built that were close, but always not quite right.

Big company examples abound. Contrast and Apple keynote to a Google one. Sometimes I wonder if the people presenting at the Google one even work at the same company.