Job 8-unit test exercise

Source: Internet
Author: User

Test cases:

According to the program input, the following equivalence classes can be divided:

    1. Set of input values: integer
    2. Number of input values: 3
    3. To form a triangle, the default input value range is positive.
    4. When a triangle is formed, the input value must follow the following rule: the sum of the two sides is greater than the third side;
    5. Triangle equivalence
    6. Isosceles triangle
    7. Equilateral triangle
    8. Right Triangle
Serial number Test input: three sides (A, B, C) Test prediction (Oracle: right angle, isosceles, equilateral triangle)
1 3, 4, 5 Right Triangle
2 2, 3, 4 Normal triangle
3 1, 2, 3 Error
4 8, 10, 8 Isosceles triangle
5 0, 0 Error
6 3, 3 Equilateral triangle
7 -1, 5, 4 Error

Experience:

I have a better understanding of unit testing and learned how to create a unit test and compile a simple unit test.

 

Job 8-unit test exercise

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.