ST:LAB1 Experimental Report (Test judgment Triangle edge length)

Source: Internet
Author: User

Lab 1 Lab Report

First, Experimental Tasks

    1. Download JUnit (4.12), Hamcrest (1.3), and add that jar package to eclipse
    2. Install Eclemma on Eclipse to show coverage for your tests.
    3. Write a Java program to determine the shape of the triangle and JUnit to test the program.

A) to determine the description of the triangle problem:

The function that determines the triangle is passed in three parameters int a, int b, and int c to represent the three sides of the triangle. And calculate and judge that the triangles are equilateral triangle, isosceles triangle, and triangular triangles that are unequal to the three sides.

Second, Experimental Process

1. Download the Junit-4.12.jar and Hamcrest-all-1.3.jar two jar packages and add two packages to the create path.

2. Download and add Eclemma to eclipse. In Eclipse's help click Eclipse Marketplace, and search for Eclemma, click Install, wait for Eclipse to restart, select coverage as to run under run.

3. Create a project under SRC to create a package (Cn.tju.scs.Triangle), under which a Triangle class is built to determine the type of triangle. Under this project, create a source folder named Test, where you create a package with the same name under the SRC folder, under which a Testpara class is created to test the running results of the program.

4. Write a procedure for judging triangles and a test program.

5. Run the program, view the results of the test, and review the coverage to modify the test case.

Third, the experimental results

Experimental data test success, coverage 100%, such as:

ST:LAB1 Experiment Report (Test judgment Triangle edge length)

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.