面向对象软件复杂性度量方法的研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
软件复杂性是软件质量的重要组成部分,其度量是软件度量的重要方面。当前,面向对象软件开发方法已经成为主流的软件开发方法但缺乏较为完善的面向对象软件复杂性度量方法。基于这样的现状,本文提出了面向对象软件复杂性度量方法的研究课题。
     本文将介绍软件度量基本理论及软件复杂性度量方法,以及度量方法评估准则。接着介绍面向对象方法的特性,以及此前已由其他学者提出的面向对象度量方法,对这些方法进行分析,并指出现有方法存在的不足之处,如C&K的DIT没有考虑所有继承路径、NOC没有考虑非直接子类、CBO没有考虑类间的耦合程度等。这些方法仅从面向对象的某些特性进行度量,不够全面。本文同时分析了面向对象度量与结构化度量的区别。
     在对传统软件复杂性度量方法、面向对象度量方法等进行分析的基础上,本文对面向对象软件复杂性进行分析,并提出复杂性分解的思想,将面向对象软件复杂性分解为类的复杂性、继承复杂性、多态复杂性、耦合复杂性和成员关系复杂性等多个复杂性分量。其中多态复杂性又可分解为强制多态、重载多态、参数多态和包含多态等复杂性。这些分量能较为全面地体现面向对象的特性。
     本文在分解的基础上分别为这些复杂性分量提出度量方法。其中,类的复杂性采用类所实现的成员的复杂性SIMC、类接口复杂性之和SCIC反映。继承复杂性可以通过继承图表示,由继承成员个数NIM、覆盖成员个数NOM、成员名重复数NRN、继承路径距离LIP和访问方式更改数NMA等几个方面反映,并采用加权合成的方式得到继承复杂性。多态复杂性可由四种类型的多态复杂性组合反映。类之间的耦合性可以通过耦合图表示,耦合复杂性可以通过耦合图中顶点间边的数量和耦合程度表示。类的成员关系使用伪二部图表示,成员关系复杂性由类成员间的交互程度表示。最后确定整体复杂性的组成成分并采用加权合成的方式得到面向对象软件的复杂性。
     为验证度量方法的有效性,本文随机选取3个VC++程序进行度量并对度量结果分析。结果表明本方法的度量结果与对这些程序复杂性的分析结果一致,从而从实际应用这个角度验证了该方法的合理性和可行性。
Software Complexity is an important composition of software quality and its measurement is vital aspect of software measurement. At the present time, object-oriented software method has become the main software development method, but there is short of perfect measurement method of object-oriented software complexity. Base on these facts, this thesis put forward study subject of measurement method of object-oriented software complexity.
     This thesis will recommends elementary theory of software measurement and estimate criterion of measurement method. Then, recommends characteristic of object-oriented method and object-oriented measurement method had put forward by other researchers, and analyze these methods and put out their faults, for example, DIT of C&K not calculate all inheritance path, NOC not calculate in-immediate descendent class, CBO not calculate how cohesion between class, etc.. These methods are measurement parts of object-oriented incompletely. At the same time, analyze the difference between object-oriented measurement and structured measurement.
     Base on analysis of traditional software complexity measurement method and object-oriented measurement method, this thesis analyze object-oriented software complexity, and put forward idea of complexity decompose, decompose object-oriented complexity into several complexity subsection such as class complexity, inheritance complexity, polymorphism complexity, couple complexity and member relation complexity. Furthermore, polymorphism complexity decompose into complexity of compel polymorphism, overload polymorphism, Parameter polymorphism, Contain Polymorphism. This complexity subsection can reflect characteristic of object-oriented completely.
     Base on complexity decompose, this thesis will put forward measurement method for each complexity subsection. Class complexity is reflected by Sum of Implemented Method Complexity (SIMC) and Sum of Class Interface Complexity (SCIC). Inheritance is expressed by inheritance graph and Inheritance complexity reflected by Number of Inherited Members (NIM), number of overriding members (NOM), Number of Repeat Names of member (NRN), Length of Inheritance Path (LIP), Number of Modified Access mode (NMA), use weighted synthesis gain inheritance complexity. Polymorphism complexity reflected by composition of four kind of Polymorphism. Couple between classes expressed by couple graph and couple complexity is reflected by edge between vertex of couple graph and couple degree. Class member relation expressed by fake bipartite graph, class member relation complexity reflected by relative of class member. Finally, figure out component which compose integrate complexity and use weighted synthesis gain object-oriented software complexity.
     In order verify validity of measurement method, the paper select 3 VC++ program randomly to measure their complexity and analyze measurement results. Analyze result imply that the measure results of measurement method that put forward by this paper are consistent with intuitionistic judgment. Sequentially validate rationality and feasibility of this method from side of real application.
引文
[1] Norman E.Fenton, Shari Lawrence Pfleeger著.杨海燕,赵巍,张力等译.软件度量[M].第二版.北京:机械工业出版社,2004.
    [2] Halstead, M. H. Elements of Software Science[J]. New York: Elsevier North Holland, 1977.
    [3] MeCabe,T.J., A Complexity Measure[J]. IEEE Transactions of Software Engineering. 1976,SE-2(4):308~320.
    [4] Pfleeger S.L.,AtleeJ.M. Software Engineering: Theory and Practice[M].北京:高等教育出版社,2006.322~332.
    [5] Loernz.M, J.Kidd. Object-Oriented Software Metrics, A Practical Guide. Englewood Clisff, N.J.: PTR Prentice-Hall,1994.
    [6] Shyam R. Chidamber and Chris F. Kemerer. A Metrics Suite for Object Oriented Design. Software Engineering[J]. IEEE Transactions on Volume 20, Issue 6, June 1994 Page(s):476~493.
    [7] Basili V.R.,L.C.Brinad,W.L.Melo. A Validation of Object-Oriented Design Metrics as Quality Indicators[J]. IEEE Transaction on Software Engineering,1996,22(10):751~761.
    [8] Brito F, Abreu E.MOOD-Metric for Object-Oriented Design[A].In: OOPSLA'94 Workshop on Pragmatic and the Oretical Directions in Object-Oriented Software Metric[C]. Portland,OR,1994.
    [9] Dvaid P.Dacry, Chris F. Kemerer. OO Metrics in Practice[J]. IEEE software, 2005, 17~19.
    [10] Wei Li. Another metric suite for object-oriented programming[J]. Journal of Systems and Software, Volume 44, Issue 2, December 1998, Pages 155~162.
    [11] J-Y Chen and J-F Lu. A new metric for object-oriented design[J]. Information and Software Technology, Volume 35, Issue 4, April 1993, Pages 232-240.
    [12] Andrina Macrus, Denys PoshVyanyk. The Conceptual Cohesion of Classes[A]. In: Proceedings of the 21st IEEE ICSM’05 on Software Maintenance[C],2005.133~142.
    [13] Kelbin.W T Popular Lectures and Addresses.1891~1894.
    [14]夏红霞.面向对象软件复杂性度量研究[D].武汉:武汉理工大学, 2006.
    [15]高鹏.面向对象软件质量的度量[D].南京:南京航空航天大学, 2002.
    [16]宋维平.基于面向对象系统的质量度量的研究[D].重庆:重庆大学, 2005.
    [17] Norman Fenton. Software Measurement: A Necessary Scientific Basis[J]. IEEE Transactions on Software Engineering Vol20, NO.3, March 1994.P199~206.
    [18] Norman E. Fenton,Shari Lawrence Pfleeger. Software Metrics: A rigorous approach[M].北京:机械工业出版社, 2003.18~33.
    [19] Horst Zuse. Software Complexity: Measures and Methods[J]. Berlin: Waiter de Gruyter,1990.605.
    [20] Rober E.Park,Wolfhart B.Goethert,William A.Florac. Goal Driven Software Measurement A Guide book[J]. Software Engineering Institute,Carnegie Mellon University, 1996.
    [21] A.L.Bkaer, J.M.Bieman,Norman E.Fenton D.A.Gustafson, A.C.Melton, and R.Whitty. A Philosophy for Software Measurement[J]. System Software,1990, 12, 227~281.
    [22] Brito F.Abreu E. MOOD-Metrics for Object-Oriented Design[A]. In: OOPSLA’94 Workshop on Pragmatic and Theoretical Directions in Object-Oriented Software Metrics[C]. Portland: OR, 1994.
    [23] Weyuker E. Evaluating Software Complexity Measures[J]. IEEE Transactions on Software Engineering, 1988, 14(9):1357~1365.
    [24] Fenton, N E Software Metrics. A rigorous approach[J]. New York: Chapman & Hall, 1991.
    [25] Cherniavsky, J.C and Smith. On Weyuker’s Axioms for Software Complexity Measures[J]. IEEE Transactions on Software Engineering, Vol.17, P636-638, 1991.
    [26] Harrison, Warren, Magel, Kenneth: A Complexity Measure Based on Nesting Level[J]. ACM SIGPLAN Notices, Volume 16(No.3): 63~74, 1981.
    [27]王振宁.程序复杂性度量[J].计算机与数字工程. Vol.26, No.5:1~5, 1998.
    [28]周苏,王文.软件工程学教程[M].第二版.北京:科学出版社, 2002.
    [29] Wolverton, R.W. The Cost of Developing Large-Scale Software[J]. IEEE Transactions on Computer, 1974, C-23(6):615~636.
    [30] Stephen H.Kan.王振宇,陈利,余扬等译.软件质量工程的度量与模型[M].北京:机械工业出版社,2003.
    [31]孙志安.软件复杂性的度量与控制[J].舰船科学技术. 1997第4期, pp35~39.
    [32]郑莉,董渊. C++语言程序设计[M].第二版.北京:清华大学出版社, 2001.
    [33] Anton Eliens著,袁兆山等译.面向对象软件开发原理[M].第二版.北京:机械工业出版社, 2003.
    [34] Y.Wand, R.Weber. An ontological evaluation of systems analysis and design methods[J]. Information Systems Concepts: An In-depth Aidysrs,Amsterdam: Elsevier Science, 1989.
    [35]伦立军,丁雪梅,李英梅,张翼.基于继承图的面向对象软件复杂性度量研究[J].计算机工程与应用2006年第27期,Pages 93-95.
    [36] Chi-Ming Chug and Mmg-Chi Lee. Inheritance-Based Object-oriented Software Metrics[J]. International Journal of Mini and Microcomputers, v16, n1, 1994, p7~15.
    [37] Chi-Ming Hung, Chun-Chia Wang, Ming-Chi Lee. Class Hierarchy Based Metric forObject-Oriented Design[J]. IEEE Region 10 Annual International Conference, Proceedings/TENCON, v2, Frontiers of Computer Technology, 1995, p 986~991.
    [38] Aaron B. Binkley, Stephen R.Schach. A comparison of sixteen quality metrics for object-oriented design[J]. Information Frocessing Letters 58 (1996) 271~275.
    [39] Marjan Hericko, Ivan Rozman, Ales Zivkovic. A formal representation of functional size measurement methods[J]. The Journal of Systems and Software 79 (2006) 1341~1358.
    [40] David P. Tegarden a, Steven D. Sheetz, David E. Monarchic, A software complexity model of object-oriented systems[J]. Decision Support Systems 13 (1995) 241~262.
    [41] Maurizio Pighin. An empirical quality measure based on complexity values[J]. Information and Software Technology 40 (1998) 861~864.
    [42] Silvia Abrahao, Geert Poels. Experimental evaluation of an object-oriented function point measurement procedure[J]. Information and Software Technology 49 (2007) 366~380.
    [43] Jingling Xue, Phung Hua Nguyen, John Potter. Interprocedural side-effect analysis for incomplete object-oriented software modules[J]. The Journal of Systems and Software 80 (2007) 92~105.
    [44] Jitender Kumar Chhabra, K.K. Aggarwal, Yogesh Singh. Measurement of object-oriented software spatial complexity[J]. Information and Software Technology 46 (2004) 689~699.
    [45] Vijay K. Vaishnavi, Sandeep Purao, Jens Liegle. Object-oriented product metrics: A generic framework[J]. Information Sciences 177 (2007) 587~606.
    [46] Ryouei Takahashi. Software Quality Classification Model Based on McCabe’s Complexity Measure[J]. Systems Sofiware 1997; 38:61~69.
    [47] A.FóTHI, J.NYéKY-GAIZLER AND Z.PORKOLáB. The Structured Complexity of Object-Oriented Programs[J]. Mathematical and Computer Modelling 38 (2003) 815~827.