SWT301_-_PE2_-_SP_2024_-_Block_5_1964.webp
Tokoyami20051

SWT301_-_PE2_-_SP_2024_-_Block_5_1964.webp

17
19
}
Output.add(item);
20
}
return Output;
21
}
Question 2 (3 points): Assuming you are assigned to conduct the component test for the method below, please design and create the minimum component test cases (Unit Test case) needed to achieve 100% statement coverage and 100% branch coverage. (Use question 2 template).
This divideAndRound method takes two integer inputs, dividend and divisor, and returns the result of dividing the dividend by the divisor and rounding the result to the nearest integer.
1
2
3
4
5
6
public static int divideAndRound(int dividend, int divisor) {
if (divisor == 0) {
throw new IllegalArgumentException("Divisor cannot be zero.");
}
Zoom
+ 100%
int result dividend divisor;
Close
Chưa có bình luận nào.

Thông tin

Category
SWT301
Thêm bởi
Tokoyami20051
Ngày thêm
Lượt xem
3,826
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
SWT301_-_PE2_-_SP_2024_-_Block_5_1964.webp
File size
134.5 KB
Dimensions
916px x 708px

Share this media

Back
Bên trên Bottom