节点文献

面向对象的类状态测试方法研究

Research on Object-oriented Class States Testing

【作者】 王锋

【导师】 徐东平; 李勇华;

【作者基本信息】 武汉理工大学 , 计算机应用技术, 2009, 硕士

【摘要】 随着软件应用领域的不断发展,软件测试作为一种保证软件质量的有效方法已经得到了广泛的重视。而面向对象技术的迅速发展,对软件测试技术又提出了新的要求,并使得研究面向对象软件测试技术成为当务之急。因此,本文从面向对象技术的特点出发,分析了面向对象软件测试面临的新问题,并结合UML技术,重点介绍了面向对象中类的状态的测试方法。在对类的状态进行测试的过程中,一般采用的是先将类的并发层次状态机转换为扩展有限状态机(EFSM),再生成测试序列的技术。但是,如果一个类包含的状态较多,特别是并发的状态较多时,在将并发层次状态机转换为EFSM时可能要考虑太多的全局状态,从而会出现状态爆炸的现象,所以本文提出了无意义Configuration的定理,即在一个Configuration中可能同时包含不能同时存在的两个状态s1和s2,对于这样的Configuration,在生成EFSM之前,就可以将此Configuration排除。本文给出了无意义Configuration的定理和其详细的证明过程,对于有些类,如果在类的并发状态中,存在着状态之间的转移条件相同或者转移条件中规定当状态发生转移时不能出现某些状态,通过应用无意义Configuration的定理,可以大大减少转换过程中全局状态的数量,从而减少了生成EFSM时所产生的状态爆炸的程度,提高了转换的效率。本文将此方法应用于温度控制系统的具体实例中,研究了该测试方法的具体实施过程,在将并发层次状态机转换为EFSM时会发现存在着无意义的Configuration,通过排除无意义的Configuration,减少了在生成EFSM时所需考虑的全局状态的数量。

【Abstract】 With the development of software applications,software testing,an effective way of assurance the quality of software,has been wide attentioned.While the rapidly development of Object-oriented technology,which brings new demands to software testing technology and makes studying object-oriented software testing technology become an urgent affair.Therefore,this paper studies the characteristics of object-oriented technology,analyses the new questions of object-oriented software testing technology,makes use of UML technology and focuses on object-oriented class status testing methods.In the process of class state testing,the general method is that transforms an And Level State Machine to an Extended Finite States Machine(EFSM) and then generates the test case.But it will generate too much global states to complex a class which contains many states especially,And states in the process of transformation,so there will be states explosion.This paper advances the concept of Nomeans Configuration,which means that there are two states,s1 and s2,can not exist at the same time in a Configuration.So,these Nomeans Configurations needn’t be deal with in the process of transformation.This paper also introduces the theorem of Nomeans Configuration and the process of proveing in detail.Through this way,it will greatly reduce the number of global states to some class,which has And states and there are same state transition conditions in the And states or it has ruled that some states can’t exist in the state transition conditions,and reduce the degree of states explosion in the process of transformation,so it will improve the efficiency of the transform.In this paper,this method has been applied to an example of temperature control system and researches the process of testing in detail.Through exclude Nomeans Configuration,it will reduce the number of global states when transforms the And Level State Machine to EFSM.

节点文献中: