1. If you could select only three test case design methods to apply during unit
ID: 3836409 • Letter: 1
Question
1. If you could select only three test case design methods to apply during unit testing, what would they be and why? Try to support your answer with apt example/ scenarios.
2. 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.
Explanation / Answer
For unit testing we need to take three test case methods every time. Two invalid inputs and one valid input to test the output of the program.
Scalene triangle: each side should not be same and angle must be same but the total of triangle is 180 Isosceles triangle: two sides and agles of a triangle must be equal and total triangle will be equals to 180 degree.
Equilateral triangle: Three sides and angles of a triangle will be equal and total triangle will be equals to 180 degree.
scalene triangle:
test case 1: sides are 30,32,20 valid input
test case 2: sides are 30,31,31 invalid input
isosceles triangle:
test case 1: sides are 30,30,20 valid input
test case 2: sides are 30,32,31 invalid input
Equilateral triangle:
test case 1: sides are 30,30,30 valid input
test case 2: sides are 30,31,31 invalid input
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.