软件测试作业3--Junit、hamcrest、eclemmat的安装和使用

1、   how to install junit, hamcrest and eclemma?

首先下载下来Junit和Hamcrest的jar包,然后新建项目的时候将这两个jar包导入到工程里面就好了。如截图所示:

 

这样就可以使用了Junit和Hamcrest工具了。

2、 然后对于安装eclemma:点击Myeclipse中的Help->Myeclipse Configure Center,然后在software下面搜索这个插件,右键点击,add to profile,就安装好了。

而对于eclipse中安装eclemma,点击Help->software Market,进去之后搜索这个插件,安装即可。

3、具体的代码可以在github上面获得:https://github.com/yanwenxiong/SoftwareTesting/

4、 实验结果:

 

 

如上图所示,我一共编写了五组测试用例,全部通过,而且代码覆盖到了几乎所有的代码。

原文地址:https://www.cnblogs.com/yanwenxiong/p/5295154.html