第一次实验

实验要求:

a)       The brief description that you install junit, hamcrest and eclemma.

b)       The test result and coverage report (print screen) of your tests on triangle problem.

--------------------------------------------------------------------------------------------------------------------

a)我的Java版本是:Oxygen.3 Release (4.7.3),自带Junit,只需写完代码后右击代码所在包 -> new -> other -> Junit -> Junit Case Test

hamcrest  :建立Java项目,在Eclipse菜单栏选择项目(Project)-> 属性 -> Java构建路径 -> 库 -> 添加外部JAR,找到hamcrest-core.jar添加

eclemma:点击help -> Eclipse Marketplace -> 在搜索区输入eclemma -> install ,然后右击项目,出现“Coverage As”选项,即说明Eclemma安装成功

b)实验结果:

上图中,红色代表未被运行,黄色代表部分运行,淡紫色代表已运行

 

 

 

 

posted @ 2018-03-24 16:16  leimingmwj  阅读(144)  评论(0编辑  收藏  举报