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
随机推荐
- Servlet 的三种跳转方式
1.Forword request.getRequestDispatcher (“url”).forword (request,response) 是请求转发,也就是说,一个 Servlet 向当前的 ...
- ckpt convert to pb
import tensorflow as tf #from create_tf_record import * from tensorflow.python.framework import grap ...
- 高级java面试宝典
1.spring事物的配置 spring事物分为俩种,一种是注解事物,一种是AOP事物注解事物的配置: 事物的隔离级别,事物的传播性,事物的超时回滚,哪些异常回滚,哪些不回滚,有默认的回滚规则注解事物 ...
- k8s管理机密信息(9)
一.启动应用安全信息的保护: Secret介绍: 应用启动过程中可能需要一些敏感信息,比如访问数据库的用户名密码或者秘钥.将这些信息直接保存在容器镜像中显然不妥,Kubernetes 提供的解决方案是 ...
- sequelize 字段无法操作
sequelize 操作的字段都必须先 define ,不然无法操作
- rabbitmq-BasicReject
拒收,是接收端在收到消息的时候响应给RabbitMQ服务的一种命令,告诉服务器不应该由我处理,或者拒绝处理,扔掉.接收端在发送reject命令的时候可以选择是否要重新放回queue中.如果没有其他接收 ...
- 用Python搞出自己的云词图 | 【带你装起来】
作者:AI算法与图像处理 参考:http://www.sohu.com/a/149657007_236714 云词图简介 什么词云 由词汇组成类似云的彩色图形.“词云”就是对网络文本中出现频率较高的“ ...
- 通过js获取本机的IP地址
参考链接:https://blog.csdn.net/qq_39327418/article/details/90052668
- CentOS7编译安装libc++和libc++abi
本文介绍了如何在CentOS 7中构建C++11构建环境 Clang的定制C++库是libc++(libcxx).然后,libcxx还需要一个ABI库,libc++abi(libcxxabi).不幸的 ...
- 洛谷 题解 CF903B 【The Modcrab】
如果它在接下来一回合能一下就将你KO了,那么,你就十分需要回血(一直回到它一下敲不死你),否则你就一直打它就好了. #include<iostream> using namespace s ...