Implementation and evaluation of measurement tool for Java
-
摘要: 介绍了面向对象度量技术,给出针对Java语言的McCabe,Halstead和WMC复杂度的定义,提出了一种新的面向Java语言的度量工具的实现方法,并且通过实例分析说明利用该工具度量Java程序,某些度量值高的模块逻辑复杂、工作量大、易错且难维护,从而引导测试人员重点测试这些模块,同时也使开发人员关注它们,仔细检查程序逻辑,进行合理优化,使整个程序的复杂度降低.确凿实验数据表明,软件度量对改进软件质量具有很大实用价值.本工具采用以下度量标准度量Java程序:针对继承复杂性的DIT(Depth of Inheritance Tree)和NOC(Number Of Children)复杂度;针对模块复杂性的McCabe度量法、Halstead软件科学度量和WMC(Weighted Methods per Class)复杂度;针对类间耦合性、聚集性的RFC(Response for a Class)度量法.每种复杂度从不同方面、不同层次度量Java程序,从而有效全面的评价软件质量,揭示可能隐藏的错误.Abstract: Introduce object-oriented metrics; define the detailed definitions of McCabe, Halstead and weighted methods per class(WMC) for Java; a new method for implementation of measurement tool for Java was offered; demonstration for using this tool to optimize program and enhance software quality was also given. Experiments show that this tool helps programmers to improve program effectively. They also show that the module with high measurement value are inclined to be complex, fallible, hard to maintain and need consume amount of labor, so testers have to pay more attention to test those modules. Developers must re-exam those modules, check their logic, and try to optimize them to depress their measurement value. By providing adequate experiment data, The results show that software measurement plays an essential roll for improving software quality. The metrics used are depth of inheritance tree(DIT), number of children(NOC), McCabe, Halstead, weighted methods per class(WMC) and response for a class(RFC). They help programmers analyze Java program at three aspects——the inheritance metrics, the module complexity metrics, and the communication metrics. So each kind of the metrics measures Java program from different aspects, evaluates the software quality effectively, and reveals the probable bugs.
-
Key words:
- softwares metric /
- metric tools /
- Java
-
[1] Systa T, Yu Ping, Muller H. Analyzing Java software by combining metrics and program visualization . Software Maintenance and Reengineering . Zurich Switzerland, 2000. 199~208 [2] Pressman R S. 软件工程——实践者的研究方法[M]. 梅 宏译. 第5版. 北京:机械工业出版社, 2002. 469~471 Pressman R S. Software engineering a practitioner's approach [M]. Translated by Mei Hong. Fifth Edition. Beijing:China Machine Press, 2002. 469~471(in Chinese) [3] 夏红霞, 童维农, 邹承明, 等. 软件复杂性度量系统的研制[J]. 计算机应用, 2000,20(4):16~17 Xia Hongxia, Tong Weinong, Zou Chenming, et al. Development of a software complexity evaluation system [J]. Computer Applications, 2000, 20(4):16~17(in Chinese) [4] Fenton N E, Pfleeger S L. Software metrics:a rigorous & practical approach[M]. Beijing:Tsinghua Press, 2003. 250 [5] Telelogic. Telelogic tau logiscope 5.1 audit-basic concepts . http://www.telelogic.com/support, 2002-01/2004-05-16 [6] Sun Microsystems. Java compiler compiler . https:javacc.dev.java.net/, 2003-01-14/2004-05-16 [7] Erich G. 设计模式:可复用面向对象软件的基础 [M]. 李英军译. 北京:机械工业出版社, 2000. 218~228 Erich G. Design patterns:elements of reusable object-oriented software . Translated by Li Yinjun. Beijing:China Machine Press, 2000. 218~228 (in Chinese)
点击查看大图
计量
- 文章访问数: 3663
- HTML全文浏览量: 214
- PDF下载量: 1597
- 被引次数: 0