作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2018, Vol. 44 ›› Issue (12): 102-107,114. doi: 10.19678/j.issn.1000-3428.0048921

• 体系结构与软件技术 • 上一篇    下一篇

面向C程序的环形复杂度自动化计算方法

秦振华,牟永敏   

  1. 北京信息科技大学 计算机学院,北京 100101
  • 收稿日期:2017-10-12 出版日期:2018-12-15 发布日期:2018-12-15
  • 作者简介:秦振华(1992—),男,硕士,主研方向为软件自动化测试;牟永敏,教授、博士。
  • 基金资助:

    国家自然科学基金(61370129);北京市自然科学基金(Z160002);网络文化与数字传播北京市重点实验室开放课题(5221735410);北京信息科技大学研究生教育基金(5121723403)。

Automatic Calculation Method of Ring Complexity for C Program

QIN Zhenhua,MU Yongmin   

  1. School of Computer,Beijing Information Science and Technology University,Beijing 100101,China
  • Received:2017-10-12 Online:2018-12-15 Published:2018-12-15

摘要:

为准确度量软件复杂程度,提出一种环形复杂度计算方法。借助于McCabe度量法,针对C语言程序,通过对源程序进行预处理,提取其中含有控制流信息的关键语句后对其进行分情况处理,从而无须借助控制流图即可实现程序环形复杂度的自动化计算。实验结果表明,该方法可以准确、高效地计算出程序的环形复杂度。

关键词: McCabe度量法, 控制流图, 环形复杂度, 复合条件, 自动化计算

Abstract:

In order to accurately measure the complexity of software,this paper proposes a calculation method of ring complexity.With the help of McCabe metric method,aiming at C language program,by preprocessing the source program,the key statements which contain the control flow information is extracted.The key sentences are processed separately so as to realize the automatic calculation of program ring complexity,and do not need to use the Control Flow Graph(CFG).Experimental results show that the method is feasible and can calculate the ring complexity of the program accurately and efficiently.

Key words: McCabe metric method, Control Flow Graph(CFG), ring complexity, compound condition, automatic calculation

中图分类号: