摘要
在类测试时,需要驱动程序来运行可执行的类测试用例并收集测试结果,因此驱动程序的开发工作量将直接影响类测试的效率。本文给出了一种类测试驱动程序的构造框架。利用面向对象技术的设计思想,设计了一个驱动基类,通过继承驱动基类,并覆盖驱动基类中的虚函数而生成一个被测类的驱动类。同时在主控程序中注册被测试类的驱动类,从而得到被测试类的驱动程序。最后通过一个实例,说明该驱动构造框架的可行性。
The test driver must be constructed to run test case and collect test result at the class test level. So the cost of constructing a driver will have direct influence on the class test. This paper presents a framework to construct class test driver automatically. The design of the framework adopts the Object oriented Polymorphism. In the frame- work, firstly, by inheriting the TestDriver and overriding the virtual function of the TestDriver, the driver class of CUT(class under test)will be produced; and then the driver of the CUT will be registered in the main control pro- gram. Finally, the driver of the CUT will be constructed correctly. In the end, this paper presents an instance to show the feasibility of the framework.
出处
《计算机科学》
CSCD
北大核心
2005年第3期159-161,185,共4页
Computer Science
基金
国家自然基金(编号:60173030)