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
随机推荐
- 5.性能测试工具比较:Jmeter和LR
性能测试工具较多,无法一一进行介绍,感兴趣者可自行搜索资料学习.需要说明的是工具使用方法和原理都大同小异,掌握一个,其他皆可快速上手. 下面就以服务端的性能测试工具为例,对市场上最常用,知名度较高,也 ...
- mongodb download
https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl
- Windows10 64位 安装 Postgresql 数据库
1,下载Postgresql 10.7 版本,下载地址 https://www.enterprisedb.com/downloads/postgres-postgresql-downloads 2 ...
- asp.net mvc 中Html.ValidationSummary显示html
@if (!ViewData.ModelState.IsValid) { <div>@Html.Raw(HttpUtility.HtmlDecode(Html.ValidationSumm ...
- Nginx sticky模块实现session粘滞
一:下载,解压nginx sticky模块. 1 2 3 # cd /usr/local/src # wget http://nginx-sticky-module.googlecode.com/fi ...
- EPP状态码
服务器状态代码由您的域的注册表设置 EPP状态码 RDAP状态映射 这是什么意思? 你应该做点什么吗? addPeriod 加期 该宽限期是在域名初始注册后提供的.如果注册服务商在此期间删除了域名,则 ...
- sqlmap(网站数据库注入)
*教程 http://www.nxadmin.com/tools/1241.html 一.ASP网站 1. sqlmap -u “http://www.czypjx.com/News_show.asp ...
- 《MIT 6.828 Lab 1 Exercise 2》实验报告
本实验链接:mit 6.828 lab1 Exercise2. 题目 Exercise 2. Use GDB's si (Step Instruction) command to trace into ...
- React—组件生命周期详解
React—组件生命周期详解 转自 明明的博客 http://blog.csdn.net/slandove/article/details/50748473 (非原创) 版权声明:转载请注明出处,欢 ...
- java动态更新枚举类
工作中遇到需要对枚举类的值进行动态更新 手动改不现实也不方便 现记录下来方便以后学习使用 1.在工程utils包中添加动态更新枚举类得工具类(根据自己得项目,放到指定位置调用就可以) 2.一开始陷入了 ...