编写一个Java程序来获取JUnit测试用例的语句覆盖范围?
例如:
public Integer addIfXGreaterThanY(int x, int y){
Integer z = null;
if (x > y) {
z = x + y;
}
else {
z = x - y;
}
return z;
}
输出:
Test case 1 inputs: 10, 15
output(line numbers covered): 1, 2, 5, 6
and another call will produce:
Test Case 2 inputs: 15, 10
output(line numbers covered): 1, 2, 3, 6
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句