Software Test Experiment One

Source: Internet
Author: User

Lab 1 Junit and Eclemma

A. Experimental Requirements:

    1. Install Junit (4.12), Hamcrest (1.3) with Eclipse
    2. Install Eclemma with Eclipse
    3. Write a Java program for the Triangle problem and test, with Junit.

A) Description of triangle problem:

Function Triangle takes three integers a,b,c which are length of triangle sides; Calculates whether the triangle is equilateral, isosceles, or Scalene.

two. Experimental steps:

(i) Import of JUnit (4.12), Hamcrest (1.3):

    1. Download the JUnit (4.12). jar, Hamcrest (1.3). jar, provided by the teacher on the Office Web.
    2. I use the MacBook, so use idea programming easier, open idea, click File, and then click Project Structure.

file:///Users/Cherie_Wang/Desktop/screen shot%202016-03-18%20 am 11.51.14.png

    1. Click on the library on the right to add two. jar packages.

file:///Users/Cherie_Wang/Desktop/screen shot%202016-03-18%20 am 11.51.49.png

(ii) Import Eclemma:

There is no need to install Eclemma because the idea comes with the program overlay.

(iii) Programming:

Because the teacher's experimental requirements are to determine whether it is equilateral triangle, isosceles triangle and triangular triangle, so my program is only considered three cases, and only used the integer type for testing, not considered double type. Able to meet test instructions.

(d) Experimental test results and program coverage diagram:

file:///Users/Cherie_Wang/Desktop/screen shot%202016-03-18%20 am 11.46.29.png

file:///Users/Cherie_Wang/Desktop/screen shot%202016-03-18%20 am 11.48.57.png

file:///Users/Cherie_Wang/Desktop/screen shot%202016-03-18%20 am 11.47.27.png

three. Experimental Conclusion:

The test results are realistic, with a program coverage of 80%.

Software Test Experiment One

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.