Lab 1 Junit and Eclemma
1. Install Junit(4.12), Hamcrest(1.3) with Eclipse
右键点击项目,点击build path —> add libraries
选择JUnit
选择JUnit资源库类型即可
安装结果如下:显示junit和hamcrest 已经安装完成
2. Install Eclemma with Eclipse
选择Help->Eclipse Marketplace->搜索EclEmma,Install;
重启eclipse发现工具栏上出现Coverage图标,说明安装成功;
3. Write a java program for the triangle problem and test the program with Junit.
Description of triangle problem:
Function triangle takes three integers a,b,c which are length of triangle sides; calculates whether the triangle is equilateral, isosceles, or scalene.
test result
verage result: