摘要
存储过程的测试是一项非常繁琐的工作,一些数据库产品虽然提供了一些工具能够统计出存储过程的执行时间、返回记录数等信息,但是这些工具不能进行批量的重复的测试,而且测试结果的显示也不直观。针对这些问题,介绍了在Junit测试框架下实现存储过程自动化测试的方法,利用JUnit的自动化和生成的测试代码的复用,可实现存储过程的回归测试,利用XML技术存储测试用例和测试结果,实现测试用例和测试代码分离,提高了测试效率,为开发人员提供了直观的测试结果。
Stored procedure test is an extremely tedious work.Some database products provide some tools to be able to make the statistics of the execution time of a stored procedure,the number of records and other information,but these tools can not carry on batch and repeated testing.Moreover,the test result is not intuitive.This paper describes the implementation scheme of stored procedure automation test under the junit framework.The code-reuse technique based automatic testing framework of Junit realizes the regression testing of procedure.The test cases are described and organized using XML to realize the separation between code and data in order to improve efficiency of test,and the test result using XML provides developers with an intuitive notation.
作者
马竹根
MA Zhu-gen(Department of Computer Science and Technology,Huaihua University,Huaihua 418008,China)
出处
《电脑知识与技术》
2009年第12X期10252-10253,共2页
Computer Knowledge and Technology