Lab 1 Junit and Eclemma
A. Experimental Requirements:
- Install Junit (4.12), Hamcrest (1.3) with Eclipse
- Install Eclemma with Eclipse
- 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):
- Download the JUnit (4.12). jar, Hamcrest (1.3). jar, provided by the teacher on the Office Web.
- 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
- 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