测试计划 - revision 1

单元测试

Web系统

如下类型的组件必须被测试:Controller, Repository, Service

由于系统使用Java语言开发,将使用JUnit 4.12进行单元测试。

为了在测试时能够对MVC框架进行模拟,需要使用spring-test配合Spring框架。

使用流行的mockito实现Testing Stub,例如仓库(Repository)、API Endpoint等

为了方便书写断言,另一个工具包hamcrest将被使用。类似这样:

assertThat("chocolate chips", theBiscuit.getChocolateChipCount(), equalTo(10)); 
assertThat("hazelnuts", theBiscuit.getHazelnutCount(), equalTo(3));

 

posted @ 2016-04-18 14:36  Judgment  阅读(172)  评论(0编辑  收藏  举报