lab1-Junit&Eclemma

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了lab1-Junit&Eclemma相关的知识,希望对你有一定的参考价值。

Software Testing, Lab 1

March 10. 2016, by 赵国佺(3014218108)

一、     environment setup

Firstly, I download the eclemma Zip from our ST’s course web. Because it is my first time to add plugins into Eclipse. So I search it on the Internet, by the help of them. I copy the file and paste it into the dropins folder. And delete a file.

 技术分享

Ok, if we can see the pic on the tool list, the eclemma is installed successfully.

       What is more, the jUnit is a very powerful plugin and it’s also to use.

Click right button on the project folder->choose properties->Java Build Path->Add external JARS(choose what you want* hamcrest and jUnit)

After we do this, we have already setup the Testing environment.

二、     code and analysis

1.Test with no error.

Because I push my code on the Internet, So what I use in this section are only printscreens.

Step1: Writing the Java code. (Triangle Class)

Step2: Use some true test case to test.

 技术分享

What is more, running the code with jUnit, we will get the results, all right.

 技术分享

 

 技术分享

 

And click the Coverage As, we get the result——

技术分享

Because we use all the right test cases, so we get the 100% coverage.

 

2.Test with some errors.

技术分享

If we delete the Annotation, the jUnit will help us to find failure.

技术分享

Also can find the wrong code not be covered. The coverage percent is deceased to64.1%.  

技术分享

 

以上是关于lab1-Junit&Eclemma的主要内容,如果未能解决你的问题,请参考以下文章

人民日报报道:伟大复兴!数字货币震撼来袭!

python 模块 SQLalchemy

要求的参考折叠规则的简明解释:(1) A& & -> A& , (2) A& && -> & , (3) && &a

Java String 将 '&' 替换为 & 而不是 & 到 &

Oracle基本语法&&函数&&子查询&&分页查询&&排序&&集合操作&&高级分组函数

breakpoints && lldb  && chisel 的使用