Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Suppose that we have a class with some method that takes four input values, each representing one side of a proper tetragon. The function returns
Suppose that we have a class with some method that takes four input values, each representing one side of a proper tetragon. The function returns the information a String telling whether the given values represent the side lengths of a Square, a Rectangle, or a Trapezoid. public class identifyShapes public String identifyTetragonint a int b int c int d throws NotAValidTetragon, InvalidSideException The method throws a NotAValidTetragon exception if the supplied values do not fit into any of the possible three tetragons it is expected to find out, and the function throws a InvalidSideException if any of the supplied values do not represent a valid value for a geometric shape. Types of proper tetragons the function can discriminate are: a Identify the equivalence classes for both the input and output domains of the above function, and come up with a proper diagram similar to the partitioning diagram available on slide # of lecture notes for week that depict those equivalence classes. slide # of lecture notes for week: b Develop a set of test cases, ie test suite for the method for which a Java signature is given above. You are NOT expected to write the Java source code for the implementation of the above given method, but only to list the test inputs, and expected outputs, ie fill in the below table. You can add rows to the below table as required. Make sure that each equivalence class you identified above is covered with at least one test case, and also boundary value analysis is applied for all boundaries present in your partitions. Hint: Do not neglect the invalid behavior tests! TestCaseNumber Unit Under Test a b c d Expected output TC# TC# TC#n a What type of testing can you perform via the above written test cases for question b Assume that all test cases you devised above passed against some implementation of the identifyTetragon method mentioned above. Furthermore, assume that you have another function which takes a String indicating the type of some geometric shape, and outputs a small Unicode symbol of that geometric shape on the terminal console. public void printShapeInfo String shape if shape.equalscircle System.out.println uef; Unicode for a small circle: else if shape.equalstriangle System.out.println ub; Unicode for a small triangle:geotriangle else if shape.equalssquare System.out.println ua; Unicode for a small square:geoquad else if shape.equalstrapezoid System.out.println uca;Unicode for a small trapezoid: else System.out.println I dont know this shape!!!; Assume also that all test cases devised to test the printShapeInfo passed, ie printShapeInfo prints the correct symbol for the given shape information. The aim is to test a Java program developed by using the above given methods, which, when the user enters four integers representing a tetragon, prints the small symbol of that tetragon on the console. Come up with an integration test scenario in which both identifyTetragon and printShapeInfo methods are tested collectively in an integrated fashion ie the return value of one method is used as an input to the second but the test scenario fails. What might have caused the integration test to fail even though both of the individual methods are known to be bug free? Please explain your answer with specific examples.
Suppose that we have a class with some method that takes four input values, each representing one side of a proper tetragon. The function returns the information a String telling whether the given values represent the side lengths of a Square, a Rectangle, or a Trapezoid. public class identifyShapes public String identifyTetragonint a int b int c int d throws NotAValidTetragon, InvalidSideException The method throws a NotAValidTetragon exception if the supplied values do not fit into any of the possible three tetragons it is expected to find out, and the function throws a InvalidSideException if any of the supplied values do not represent a valid value for a geometric shape. Types of proper tetragons the function can discriminate are:
a Identify the equivalence classes for both the input and output domains of the above function, and come up with a proper diagram similar to the partitioning diagram available on slide # of lecture notes for week that depict those equivalence classes.
slide # of lecture notes for week:
b Develop a set of test cases, ie test suite for the method for which a Java signature is given above. You are NOT expected to write the Java source code for the implementation of the above given method, but only to list the test inputs, and expected outputs, ie fill in the below table. You can add rows to the below table as required. Make sure that each equivalence class you identified above is covered with at least one test case, and also boundary value analysis is applied for all boundaries present in your partitions. Hint: Do not neglect the invalid behavior tests!
TestCaseNumber Unit Under Test a b c d Expected output
TC#
TC#
TC#n
a What type of testing can you perform via the above written test cases for question b Assume that all test cases you devised above passed against some implementation of the identifyTetragon method mentioned above. Furthermore, assume that you have another function which takes a String indicating the type of some geometric shape, and outputs a small Unicode symbol of that geometric shape on the terminal console. public void printShapeInfo String shape
if shape.equalscircle System.out.println uef; Unicode for a small circle:
else if shape.equalstriangle System.out.println ub; Unicode for a small triangle:geotriangle
else if shape.equalssquare System.out.println ua; Unicode for a small square:geoquad
else if shape.equalstrapezoid System.out.println uca;Unicode for a small trapezoid:
else System.out.println I dont know this shape!!!;
Assume also that all test cases devised to test the printShapeInfo passed, ie printShapeInfo prints the correct symbol for the given shape information. The aim is to test a Java program developed by using the above given methods, which, when the user enters four integers representing a tetragon, prints the small symbol of that tetragon on the console. Come up with an integration test scenario in which both identifyTetragon and printShapeInfo methods are tested collectively in an integrated fashion ie the return value of one method is used as an input to the second but the test scenario fails. What might have caused the integration test to fail even though both of the individual methods are known to be bug free? Please explain your answer with specific examples.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started