单体测试式样书模板
单体测试式样书模板
篇一:单体测试-Guide Unit Test Guide Prepared by: Peng-ChuanYuan Kneey@ Date Prepared: Nov 6th, XX Document Revision History 目录 1. 概述 ................................................................................................................................................................ 4 说明 ..................................................................................................................................................... 4 2. 写测试Case ................................................................................................................................................... 4 了解Junit测试的Framework .............................................................................................................. 4 TestCase存放路径 ............................................................................................... 错误!未定义书签。 TestCase的基类 ................................................................................................................................. 4 每个Case类都需要有suite方法 ........................................................................................................ 5 一个TestCase类只执行一次setUp和tearDown的方法 ................................................................... 5 关于Mock对象的说明 ......................................................................................................................... 6 3. 辅助测试工具说明 .......................................................................................................................................... 6 私有方法测试 ....................................................................................................................................... 6 DBUnit准备数据库测试辅助工具 ........................................................................................................ 6 基于Spring的Dao测试辅助工具 ........................................................................ 错误!未定义书签。 4. 测试和测试报告 ................