12 ms·
LOC (Lines of Code) is not a good characterization of the quality of code Actually it is. Or at least it's the best we have. When it comes to anything you can
by gruseom 15y ago
LOC (Lines of Code) is not a good characterization of the quality of code
Actually it is. Or at least it's the best we have. When it comes to anything you can measure, the evidence points to program length as the best predictor of quality of code. And LOC is, for better or worse, the standard metric for code size.
We had a whole thread on HN about this a month ago. Specific studies are cited there. http://news.ycombinator.com/item?id=3037293 http://news.ycombinator.com/item?id=3037293
Speaking of which, someone later told me that Chapter 27 of McConnell's Code Complete cites studies according to which bug count grows as a mild exponential function of code size. I don't have that book handy. If anyone does, can they look at Chapter 27 and tell us what it says?
- arohner 15y agoMy edition is copyright 1993. In Chapter 21.3, they cite Capers Jones 1977 "Program Quality and Programmer Productivity". (Couldn't find a handy link online, appears to be http://www.amazon.com/Program-quality-programmer-productivity-Technical/dp/B0006XJJ80 http://www.amazon.com/Program-quality-programmer-productivit...) They report the following table Project Size (LoC) Error Density (Bugs / kLoC) 0-2k 0-25 2k-16k 0-40 16k-64k 0.5-50 64k-512k 2-70 512k or more 4-100 So yes, the error density increases with LoC.