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的更多相关文章

  1. 软件测试:lab1.Junit and Eclemma

    软件测试:lab1.Junit and Eclemma Task: Install Junit(4.12), Hamcrest(1.3) with Eclipse Install Eclemma wi ...

  2. ucore操作系统学习笔记(一) ucore lab1系统启动流程分析

    一.ucore操作系统介绍 操作系统作为一个基础系统软件,对下控制硬件(cpu.内存.磁盘网卡等外设),屏蔽了底层复杂多样的硬件差异:对上则提供封装良好的应用程序接口,简化应用程序开发者的使用难度.站 ...

  3. 2.ASP.NET MVC 中使用Crystal Report水晶报表

    上一篇,介绍了怎么导出Excel文件,这篇文章介绍在ASP.NET MVC中使用水晶报表. 项目源码下载:https://github.com/caofangsheng93/CrystalReport ...

  4. Monthly Income Report – August 2016

    原文链接:https://marcoschwartz.com/monthly-income-report-august-2016/ Every month, I publish a report of ...

  5. 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 ...

  6. Session for SSRS Report of Microsoft Dynamics AX

    Session for SSRS Report of Microsoft Dynamics AX 版权声明:本文为博主原创文章,未经博主允许不得转载. Contract •A data contrac ...

  7. Report processing of Microsoft Dynamic AX

    Report processing of Microsoft Dynamic AX 版权声明:本文为博主原创文章,未经博主允许不得转载. The implementation of a general ...

  8. Utility3:Understand Dashboard Report

    To see data in the SQL Server Utility dashboard, select the top node in the Utility Explorer tree - ...

  9. PowerDesigner导出Report通用报表

    PowerDesigner导出Report通用报表 通用模板下载地址:http://pan.baidu.com/s/1c0NDphm

随机推荐

  1. @Autowired注解与@Resource注解的区别与用法

    Spring不但支持自己定义的@Autowired注解,还支持JSR-250规范定义的几个注解.如:@Resource.@PostConstruct及@PreDestroy 1. @Autowired ...

  2. Qt编写自定义控件33-图片切换动画

    一.前言 在很多看图软件中,切换图片的时候可以带上动画过渡或者切换效果,显得更人性化,其实主要还是炫一些,比如百叶窗.透明度变化.左下角飞入等,无论多少种效果,核心都是围绕QPainter来进行,将各 ...

  3. 动手生成 Delphi xe DBTreeview

    tProductType表结构如下 object FDConnection1: TFDConnection    Params.Strings = (      'Database=ClothingT ...

  4. NLP之ROUGE[笔记]

    0 前言 [定义]ROUGE:recall-oriented understanding for gisting evaluation,面向召回的要点评估理解 召回率,recall rate;要点,g ...

  5. 深入理解channels - kavya Joshi

    From: 翻译blog地址 作者:大桥下的蜗牛 这是GopherCon 2017大会上,go开发专家 kavya Joshi 的一篇关于 channel 的演讲,讲的通俗易懂. Understand ...

  6. web框架学习路线

    0.配置 1.路由 2.view 3.model 4.序列化与反序列化. 5.auth&permission 6.header处理 7.http client

  7. Vuetify Warning: Unable to locate target [data-app]

    今天在大改 nuxt 项目 layout 的时候,将 Vuetify 的 side nav 换成 Element 的折叠式 nav 后,发现了一个 Warning,虽然不影响使用,但是控制台输出一堆, ...

  8. mysql写存储过程根据时间变化增加工龄

    在工作中遇到要程序根据时间自动增加工龄的需求. php没办法自己发起请求,又不想在服务器上写计划任务crontab,通过用户请求来更改又不能保证用户会去操作. 用数据库的存储过程和事件来完成. 数据库 ...

  9. 【ARM-Linux开发】打包解包命令

    tar命令 解包:tar zxvf FileName.tar 打包:tar czvf FileName.tar DirName gz命令 解压1:gunzip FileName.gz 解压2:gzip ...

  10. 【FFMPEG】【ARM-Linux开发】 ffmpeg 静态库使用,undefined reference错误

    原文:http://blog.csdn.net/chinazjn/article/details/7954984 ffmpeg移植到dm365上,遇到undefined reference错误: GA ...