We use cookies to improve your experience with our site.

面向对象的系统的基于代码的分析

Code Based Analysis for Object-Oriented Systems

  • 摘要: 由于面向对象软件的基本特征,传统的测试方法很难应用于其中。而控制流图是一个在过程软件中用于鉴别独立路径的著名的模型。本文着重介绍在面向对象系统中如何构造控制流图,并对面向对象软件的基于代码的分析提出了一个名为扩展控制流图(ECFG)的新模型。扩展控制流图(ECFG)是一个分层的控制流图,其一个节点表示一个方法而不是语句。本文还提出一个类似于McCabe的圈复杂度(CC)的新量度方法—扩展圈复杂度(ECC),其扩展圈复杂度表示在面向对象软件中的独立执行路径的数量。根据在面向对象软件中的方法调用的特性,控制流程图之间可以通过不同的方式连接起来。本文提出了控制流图与扩展控制流图链接的新方法和针对不同例子的E-CC形式化方法。随后,我们描述了扩展控制流图和从类似的图到“基础集合”的实现方法。这会对代码测试产生测试用例带来帮助。在CFG被用做单元测试的同时,ECFG也会用作对所有面向对象软件类的综合测试。最后,我们在一个用Java编写的代码例子上应用我们的模型,计算ECC和基础集合去证实我们的解决方法。尽管我们的模型可以用在带有函数调用的过程系统中,但是它更适用于面向对象系统,ECFG对实时动态绑定的连通性方法更具有启发意义。

     

    Abstract: The basic features of object-oriented software makes itdifficult to apply traditional testing methods in object-orientedsystems. Control Flow Graph (CFG) is a well-known model used foridentification of independent paths in procedural software. This paperhighlights the problem of constructing CFG in object-oriented systemsand proposes a new model named Extended Control Flow Graph (ECFG) forcode based analysis of Object-Oriented (OO) software. ECFG is a layeredCFG where nodes refer to methods rather than statements. A new metrics--- Extended Cyclomatic Complexity (E-CC) is developed which is analogousto McCabe's Cyclomatic Complexity (CC) and refers to the number ofindependent execution paths within the OO software. The different waysin which CFG's of individual methods are connected in an ECFG arepresented and formulas for E-CC for these different cases are proposed.Finally we have considered an example in Java and based on its ECFG,applied these cases to arrive at the E-CC of the total system as wellas proposed a methodology for calculating the basis set, i.e., the set ofindependent paths for the OO system that will help in creation of testcases for code testing.

     

/

返回文章
返回