Professional Documents
Culture Documents
Unit 05 - 04
Unit 05 - 04
The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The
three values are interpreted as representing the lengths of the sides of a triangle. The program
prints a message that states whether the triangle is scalene, isosceles, or equilateral. Develop a set
of test cases (at least 6 ) that you feel will adequately test this program. (This is a classic testing
problem and you could find numerous explanations about it on the internet. I would recommend
that you try to submit your own answer, based on your understanding of the topic).
Answer:
Here are some test cases that can be used to test the program:
Test case where all sides of the triangle are equal: (3, 3, 3) Expected output: Equilateral triangle
Test case where two sides of the triangle are equal and one is different: (4, 4, 5) Expected output:
Isosceles triangle
Test case where all sides of the triangle are different: (5, 6, 7) Expected output: Scalene triangle
Test case where one side is zero and the other two sides are non-zero: (0, 4, 5) Expected output: Not
a triangle
These test cases cover different scenarios that the program should be able to handle correctly.