SWT301_-_SP_2025_-_PE_3673.webp
Ngọc Phương2

SWT301_-_SP_2025_-_PE_3673.webp

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
Chưa có bình luận nào.

Thông tin

Category
SWT301
Thêm bởi
Ngọc Phương2
Ngày thêm
Lượt xem
5,205
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom