无论使用何种语言,每行代码的错误数量都是恒定的,这一说法的依据
我听人说过(虽然我不记得具体是谁),无论使用什么语言,每行代码的错误数量大致是恒定的。支持这一点的研究是什么?
编辑添加:我无权访问它,但显然是 本文 “询问用不同编程语言编写的程序每行代码 (LOC) 的错误数量是否相同。”
I've heard people say (although I can't recall who in particular) that the number of bugs per line of code is roughly constant regardless of what language is used. What is the research that backs this up?
Edited to add: I don't have access to it, but apparently the authors of this paper
"asked the question whether the number of bugs per lines of code (LOC) is the same for programs written in different programming languages or not."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Steve McConnell 在他的书 Code Complete(引自第二版)的“开发人员测试”一章中引用了一些跨多种语言的研究:
这些研究范围从 Java 等高级语言,到 C++ 和 C,一直到汇编。考虑到 Code Complete 对软件工程作为一门学科的巨大影响,我怀疑它对普及这一想法负有责任。
In his book Code Complete (quoting from the 2nd Edition), in the chapter "Developer Testing," Steve McConnell cites a handful of studies across a variety of languages:
These studies ranged from high-level languages like Java, down to C++ and C, all the way down to assembly. Considering the massive impact of Code Complete on software engineering as a discipline, I suspect it is responsible for popularizing this idea.
一个可能的来源是 Les Hatton 1995 年的论文“计算机编程语言和安全相关系统”,他得出的结论是,语言选择至少接近无关紧要,其他因素(主要是所选语言的流利程度)是控制因素。
我能补充的就是总结各种其他论文,其中给出了各个项目(等)的缺陷率。我做了一些研究,但从未发现语言和缺陷率之间存在相关性,但这并不等同于说缺陷率在不同语言之间是恒定的(即,它们可能是不同的,但它们在每种语言中的差异如此之大,以至于我无法证明差异)。
One possible source would be Les Hatton's 1995 paper "Computer programming languages and safety-related systems", in which he concludes that language choice is at least close to irrelevant and other factors (chiefly fluency in the chosen language) are the controlling factors.
About all I could add to that would be to summarize various other papers, in which defect rates for individual projects (and such) are given. I've done a bit of looking, and never found a correlation between language and defect rate, but that's not really the same as saying the defect rate is constant across languages (i.e., they may be different, but they vary so widely within each language that I've never been able to prove a difference).