摘要: 类的状态测试是面向对象软件测试的重要内容,类的单元测试归结为测试类的数据成员和成员函数。该文提出了基于类的状态模式测试用例生成方法,从类的状态常量、状态变量以及成员函数等方面测试类的一致性与完整性,指出只有满足类的状态常量的约束条件与状态变量的前置条件和后置条件的测试数据,才能充分检验类的状态模式中存在的不一致、不完整性错误。
关键词:
类测试,
状态模式,
测试用例生成
Abstract: The state test of class is an important component part of object-oriented software test. Class unit test comes down to test the data member and member function. An approach of test cases generation based-on the class state model is proposed, and test consistency and integrality of classes form state constant, state variable and member function. A result is gained that only the test data which satisfies the restraint conditions of state constant and the pre-condition and post-condition of state variable fully test inconsistency and imperfect in tested classes.
Key words:
Class test,
State mode,
Test case generation
龚红仿;童小娇. 基于状态模式的面向对象的类测试技术研究[J]. 计算机工程, 2007, 33(02): 44-46.
GONG Hongfang; TONG Xiaojiao. Research on Object-oriented Class Test Technology Based on State Mode[J]. Computer Engineering, 2007, 33(02): 44-46.