Kizspy. me estion 3 (2 points): Component Test Case Design
Below is a method for calculating insurance premiums based on age and insurance type.
public double calculatePremium(int age, String insuranceType) {
if (age<18) {
return 0;
} else if (age <30) {
if (insuranceType.equals("Health")) return 1000;
else return 1200;
} else if (age<50) {
if (insuranceType.equals("Health")) return 1500;
else return 1800;
} else {
return 2000;
}
Design Unit Test Cases to ensure:
•
100% Statement Coverage
•
100% Branch Coverage
Zoom
•
100% Equivalence Partitioning Coverage
100% Boundary Value Coverage
Answer requirements:

List all required test cases (including input values and expected output).
Explain how the test cases ensure full coverage.
+ 100%
Close