有没有一本书概述了不同类型的源代码指标?
我必须提交一篇关于软件工程过程中源代码度量的使用的论文。我认为首先介绍一些源代码指标的分类(例如使用平面 LOC 计数与对代码进行一些静态分析)会很好,但我找不到一本可以介绍不同类型的书籍或文章指标以及可能的一些历史背景信息(我的导师比网站更喜欢书籍和文章)。
有人知道这样的来源吗?
I have to submit a paper about the usage of source code metrics in software engineering processes. I thought it would be nice to start by introducing some categorization of source code metrics (for example using plane LOC count Vs doing some static analysis of the code) , but I can't find a book or article that will present the different types of metrics and possibly some historical background information (books and article are favored by my instructor over web sites).
any one knows of such a source ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Patrick Smacchia 的 NDepend 网站有一组很好的定义:指标定义。他的 NDepend 工具(适用于 .NET)提供了许多不同的量化代码库的方法。
指标有多有用,这是一个更有争议的问题。它们非常适合获得代码库的天空级视图,但是它们在日常中有用吗?有多少商店每周使用(或关心)指标?我怀疑大多数人更关心错误数量:修复的错误数量和报告的错误数量。
当然,诸如内聚性和耦合性之类的度量可以提供可能的重构点的指标。
另一个重要指标:有多少测试,以及这些测试大致代表了多少代码覆盖率。在没有测试和良好的测试覆盖率的情况下进行重构是一件有风险的事情。
软件指标
代码指标概述
Patrick Smacchia's NDepend site has a good set of definitions: Metrics Definitions. His NDepend tool (for .NET) provides many different ways of quantifying a codebase.
How useful metrics are, well that is a bit more contentious. They are good for getting a sky level view of a codebase, but are they useful day-to-day? How many shops out there use (or care about) metrics on a weekly basis? I suspect most are more concerned with the bug count: number of bugs fixed and number of bugs reported.
Certainly measures like cohesion and coupling give indicators of possible refactoring points.
Another important metric: How many tests are there, and roughly how much code coverage do those tests represent. Refactoring without tests and good test coverage is a risky business.
Software metric
Code Metrics Overview
Pressman 的软件工程:从业者的方法有很多关于软件指标的好信息(除其他外) )。
关于指标的关键建议可能是要小心你所衡量的内容。如果你衡量LOC,那就是人们会关注的。
Pressman's Software Engineering: A Practitioner's Approach has a lot of good information on software metrics (among other things).
Probably the key piece of advice on metrics is to be careful what you measure. If you measure LOC, that's what people will concentrate on.
软件质量工程中的指标和模型
Stephen H. Kan
读起来并不总是很有趣,但它是一本很棒的书其中深入涵盖了软件质量和指标。
Metrics and Models in Software Quality Engineering
Stephen H. Kan
Not always very fun to read, but it's an excellent book that covers software quality and metrics in depth.
Halstead 的“软件科学要素” 是该领域的开创性著作。我记得这个故事,他定义了大约 15 个不同的指标,所有指标都旨在衡量一段代码的不同质量。
不幸的是,van der Meulen & Revilla 表明,几个关键指标与 SLOC(源代码行)密切相关。 (这不是第一次被证明,但这是我能很快找到的第一篇论文。)由于 SLOC 比其他东西更容易测量,所以 SLOC 是应该测量和管理的。
Halstead's "Elements of Software Science" was the seminal work in this area. As I recall the tale, he defined some 15 different metrics, all purporting to measure different qualities of a piece of code.
Unfortunately, van der Meulen & Revilla showed that a couple of key metrics are very strongly correlated with SLOC (source lines of code). (This was not the first time this had been demonstrated, but it was the first paper I could find quickly.) Since SLOC is far easier to measure than the other things, SLOC is what should be measured - and managed.
PSP:软件工程师的自我改进过程,作者:Watts S. Humphrey
PSP: A Self-Improvement Process For Software Engineers by Watts S. Humphrey
另请检查 SLOCCount。这不是一本书,而是一套用于计算物理源代码行数的工具。浏览其用户手册以及网站中有关使用 SLOCCount 进行估算的论文Linux 内核大小将使您深入了解 SLOC 指标的有效性、将其用作指标的问题、COCOMO 模型中用于工作量估计的 SLOC 指标的使用情况。
Also check SLOCCount. This is not a book but a set of tools for counting physical Source Lines of Code. Going through its user manual and the papers in the site about the usage of SLOCCount for estimating Linux kernel size will give you insight about effectiveness of SLOC metrics,issues in using it as metric, usage of SLOC metric in the COCOMO model for effort estimate.
这不是一本书,但 Sonar 使用的指标提供了实用的代码指标的良好列表。这是指标定义页面。
It's not a book, but the metrics used by Sonar offer a good list of practically useful code metrics. Here's the metric definitions page.
正如我刚刚在 我关于可视化更改的问题中提到的在指标中,有书籍面向对象的指标:复杂性的度量< /a> 由 Henderson-Sellers 和早期的面向对象的软件指标我已经拥有很多年了。
有软件质量工程中的度量和模型,第二版,这是唯一一本可在 Safari 上找到的书籍,其具有 章节讨论上述指标和一些行业结果。
我还刚刚找到一本 2006 年的书 面向对象的指标实践:使用软件指标来表征,评估和改进面向对象系统的设计 那里没有评论(不是一个好兆头),但听起来很有趣。
As I just mentioned in my question on visualizing changes in metrics, there are the books Object-Oriented Metrics:Measures of Complexity by Henderson-Sellers and the earlier Object-Oriented Software Metrics which I've owned for years.
There's Metrics and Models in Software Quality Engineering, Second Edition, the only one of the books available on Safari which has a chapter discussing the above metrics and some industry results.
I also just found a 2006 book Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems which has no reviews there (not a good sign) but sounds interesting.