[ must do 1] for the triangle given in Appendix 1 to determine the Java code, the use of equivalent class partitioning method to design test cases. List the design test cases in tabular form and write them to your blog.
Serial number |
Test input |
Test prophecy |
1 |
3 3 3 |
Regular |
2 |
3 4 5 |
Scalene |
3 |
1 2 3 |
Illegal |
4 |
3 3 4 |
Isoceles |
Must do 2] imitate Appendix 2 gives the Triangle Judge junit test Code, Design Unit test script, test [ must do 1] design of the test cases. 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 commit the source code to your own github.
Test result diagram:
[ must do title 3] experience. Write down the knowledge you learned from this practice.
A: The JUnit test, I still do not use it, or the final question to ask students and slowly on the Internet to explore the results.
Note: Gitgub submissions always show errors and cannot be submitted. Began to think is the reason for the school network, and then changed to 4G is not, always in the last step error. The source program is first placed here:
Import static org.junit.assert.*;
Import Org.junit.Test;
public class Testtriangle {
@Test
public void TestIsTriangle1 () {
Triangle t = new Triangle (3,3,3);
Assertequals (T.gettype (t), "Regular");
}
@Test
public void TestIsTriangle2 () {
Triangle t = new Triangle (3,4,5);
Assertequals (T.gettype (t), "Scalene");
}
@Test
public void TestIsTriangle3 () {
Triangle t = new Triangle (n/a);
Assertequals (T.gettype (t), "illegal");
}
@Test
public void TestIsTriangle4 () {
Triangle t = new Triangle (3,3,4);
Assertequals (T.gettype (t), "isoceles");
}
}
Job 8 Unit Test exercise