测试计划 - revision 1

it2022-05-05  129

单元测试

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));

 

转载于:https://www.cnblogs.com/judgment/p/5404394.html


最新回复(0)