Write a java program to get the statement coverage of JUnit test cases?
for example:
public Integer addIfXGreaterThanY(int x, int y){
Integer z = null;
if (x > y) {
z = x + y;
}
else {
z = x - y;
}
return z;
}
Output:
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