The goal is not to execute all statements in one case, but in all test cases together. Therefor, if you combine the two cases, you cover 100% of the statements.
@@DeepakKumar2105 Because he used negative numbers in the TC2, which means the statement is in the 3rd line is FALSE, therefore we can jump to line 5. And he already covered line 4 in the TC1 which was the TRUE path. A flow chart would be so helpful here.
The main idea of "statement coverage" is to cover as many statements (declarations, lines) as possible, so, checking the false part of the decision is necessary to achieve 100% of "statement coverage"
3:03 how have we covered all the statements in the -ve values for a and b , we only covered 6/7 statements becuase we wont cover the data inside of If statement since its < 0.
I am curios to know what people think to achieving 100% code coverage? You think it is not possible in the given time or is that because you do not have good test infrastructure to inject fault and cover error branches?
Thanks! It is very helpful! Can you please clear that how to find out the total number of statements suppose we have while loop Ex..( a = 10; while (int i=0;i=5;i++) {print a}, do we also count the iterations in the loop as well?? Please any one Thanks!
printSum(int a, int b){ --- --- } printSum(int a, int b) { --- --- } Are we considering same statement count in these two scenarios or do we have to reformat it before doing this process?