8th Time Assignment

Source: Internet
Author: User

[ must do 1] for the triangle given in Appendix 1 to Judge Java code, the use of equivalent class partitioning method to design test cases, tabular form of the design of the test cases, written to the blog. (10 points)

Serial number Test input: Three edges (a,b,c) Test prophecy
1 -1,2,3 Cannot form a triangle
2 2,9,-8 Cannot form a triangle
3 3,-5,5 Cannot form a triangle
4 2,3,8 Cannot form a triangle
5 2,3,4 Triangle
6 2,2,3 Isosceles Triangle
7 2,2,5 Cannot form a triangle
8 2,2,2 Equilateral triangle
9 5,5,5 Equilateral triangle

[ must do 2] imitate Appendix 2 gives the triangle judgment junit test Code, Design Unit test script, test [ must do 1] design of the test case. Note the order in which the test cases appear in the test script is consistent with the order listed in the [ required title 1] table. Run the resulting test script, truncate the result graph, write to the blog, and push the source code to your own github.

 PackageRJGC;ImportJava.util.Scanner; Public classTriangle { Public Static voidMain (string[] args) {System.out.println ("Please input triangle three sides"); Scanner in=NewScanner (system.in); intA=In.nextint (); intb=In.nextint (); intC=In.nextint (); intmin=Math.min (Math.min (A, B), c); intmax=Math.max (Math.max (A, B), c); intmid=a+b+c-min-Max; A=min;b=mid;c=Max; if(a<=0| | b<=0| | C<=0) System.out.println ("Cannot form a triangle"); Else if(A+B&LT;=C) System.out.println ("Cannot form a triangle"); Else if(A!=B&AMP;&AMP;B!=C) System.out.println ("Triangle"); Else if(A==B&AMP;&AMP;A!=C) System.out.println ("isosceles triangle"); Else if(A==B&AMP;&AMP;A==C) System.out.println ("equilateral triangle"); }    }

[ must do title 3] experience. Write down the Knowledge points (PS: Test Case design methods and steps; test script design steps or main content) that you gain from this exercise. (10 points)

A simple triangle to judge the need to constantly test, later more difficult to imagine the algorithm. The road long its repair far XI, I will go up and down and quest.

8th Time Assignment

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.