What does the unit test summary in the report mean?

Modified on Wed, 27 Mar 2019 at 01:20 PM

Each Coverage% value in the unit test summary indicates the extent to which the overall project coverage affected the execution of that unit test.


For example,


When you execute the unit test of the func1 () function, it means that 71.42% will be executed by executing 5 out of 7 statements in the whole project.


The 5 statements executed contain the statement of the func1 () function and the function it calls (func2 ()).


Because one statement can be performed on multiple tests, the sum of the numerator of test-specific statement coverage can be greater than the total number of statements (denominator).


+example code

int func1(int);
void func2(void);
int func3(int);

int func1(int arg0){
  func2();   //statement 1;  
}
void func2(void){
  int var1;  //statement 2;
  int var2;  //statement 3;
  int var3;  //statement 4;
  var1 = var2+var3;  //statement 5;
}
int func3(int arg0){
  arg0++;      //statement 6;
  return arg0;  //statement 7;
}

+example report

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article