Lab1 Report
Lab1 report
A) The brief description that you install junit, hamcrest and eclemma.
a) install junit、hamcrest:
方式一:导入jar包。
1、鼠标右击项目名,点击‘Properties’一栏;
2、如下图点击‘Add External JARs’;

3、选中下载好的junit和hamcrest的jar包,打开即可。

方式二,添加junit库:
1、鼠标右击项目名,点击‘Properties’一栏;
2、如下图点击‘Add Library’;

3、选中Junit一栏,点击‘Next’;

4、选择Junit版本,之后点击‘Finish’。

b) install eclemma
1、下载jacoco,链接: http://www.eclemma.org/jacoco/ 根据系统选择适合的版本即可;
2、下载完成后,解压文件,将lib目录下的所有jar包放入eclipse安装目录的‘plugins’文件夹下;

3、在eclipse窗口依次点击HelpàEclipse
Marktplaceà在‘Find’一栏输入:eclemmaà点击安装即可。

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

coverage report:

source codes:
TriangleProblem.java:
package cn.tju.triangleproblem;
public class TriangleProblem {
public TriangleProblem() {
// TODO Auto-generated constructor stub
}
public String TriangleTypes(int a, int b, int c) {
if (a + b > c && b + c > a && c + a > b) {
if (a == b && b == c)
return "equilateral";
if (a == b || b == c || c == a)
return "isosceles";
return "scalene";
} else
return "Error, not a triangle!";
}
}
TriangleProblemTest.java:
package cn.tju.triangleproblem; import static org.junit.Assert.*; import java.util.Arrays;
import java.util.Collection; import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class)
public class TriangleProblemTest {
private String expectResult = "";
private int edgeA, edgeB, edgeC;
private TriangleProblem tp; public TriangleProblemTest(String expectResult, int edgeA, int edgeB,
int edgeC) {
super();
this.expectResult = expectResult;
this.edgeA = edgeA;
this.edgeB = edgeB;
this.edgeC = edgeC;
} @Before
public void setUp() {
tp = new TriangleProblem();
} @Test
public void testTriangleTypes() {
assertEquals(this.expectResult,
tp.TriangleTypes(this.edgeA, this.edgeB, this.edgeC));
} @Parameters
public static Collection<Object[]> getData() {
return Arrays.asList(new Object[][] { { "equilateral", 6, 6, 6 },
{ "isosceles", 9, 9, 8 }, { "scalene", 4, 5, 6 },
{ "Error, not a triangle!", 3, 6, 9 }});
} }
Lab1 Report的更多相关文章
- 软件测试:lab1.Junit and Eclemma
软件测试:lab1.Junit and Eclemma Task: Install Junit(4.12), Hamcrest(1.3) with Eclipse Install Eclemma wi ...
- ucore操作系统学习笔记(一) ucore lab1系统启动流程分析
一.ucore操作系统介绍 操作系统作为一个基础系统软件,对下控制硬件(cpu.内存.磁盘网卡等外设),屏蔽了底层复杂多样的硬件差异:对上则提供封装良好的应用程序接口,简化应用程序开发者的使用难度.站 ...
- 2.ASP.NET MVC 中使用Crystal Report水晶报表
上一篇,介绍了怎么导出Excel文件,这篇文章介绍在ASP.NET MVC中使用水晶报表. 项目源码下载:https://github.com/caofangsheng93/CrystalReport ...
- Monthly Income Report – August 2016
原文链接:https://marcoschwartz.com/monthly-income-report-august-2016/ Every month, I publish a report of ...
- Step by step Install a Local Report Server and Remote Report Server Database
原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...
- Session for SSRS Report of Microsoft Dynamics AX
Session for SSRS Report of Microsoft Dynamics AX 版权声明:本文为博主原创文章,未经博主允许不得转载. Contract •A data contrac ...
- Report processing of Microsoft Dynamic AX
Report processing of Microsoft Dynamic AX 版权声明:本文为博主原创文章,未经博主允许不得转载. The implementation of a general ...
- Utility3:Understand Dashboard Report
To see data in the SQL Server Utility dashboard, select the top node in the Utility Explorer tree - ...
- PowerDesigner导出Report通用报表
PowerDesigner导出Report通用报表 通用模板下载地址:http://pan.baidu.com/s/1c0NDphm
随机推荐
- QString std::string 相互转 含中文
std::string cstr;QString qstring; //QString str1 = " D:\\参考手册\\BIM\\osg\\build1.OSGB"; //从 ...
- Qt编写数据可视化大屏界面电子看板6-窗体打开关闭
一.前言 二级窗体的打开与关闭,这个功能也很有必要,由于整个系统中各种模块数量窗体数量比较多,后期可能还会增加更多,在4K屏幕上可以显示很多的模块,但是有时候有些模块不想显示出来,就需要将该模块关闭掉 ...
- 高级java面试宝典
1.spring事物的配置 spring事物分为俩种,一种是注解事物,一种是AOP事物注解事物的配置: 事物的隔离级别,事物的传播性,事物的超时回滚,哪些异常回滚,哪些不回滚,有默认的回滚规则注解事物 ...
- linux简单命令6---挂载
- 【404】int main(int argc,char * argv[]) windows 下的使用
参考:int main(int argc,char * argv[]) windows 下的使用 参考:Theprogram can't start because libgcc_s_dw2-1.dl ...
- php自定义错误处理函数
function myErrorHandler($errno, $errstr, $errfile, $errline) { echo "<b>Custom error:< ...
- laravel5.1设置cookie
Laravel 所建立的 cookie 会加密并且加上认证记号,这代表着被用户擅自更改的 cookie 会失效.从请求中取得Cookie值,你使用cookie方法 $value = $request- ...
- 一个可以让vsftpd启动系统用户登陆ftp的例子
编辑 /etc/vsftpd.conf 如下: listen=YES anonymous_enable=NO local_enable=YES check_shell=NO write_enable= ...
- css 边框和圆角
CSS3圆角 border-radius属性 一个最多指定四个border -*- radius复合属性,这个属性允许你为元素添加圆角边框 语法 border-radius:1-4 length|% ...
- 退出virtual box 独占键盘和鼠标
先按住右边的Alt键,然后按一下(右边)ctrl键