In statement "33.08% covered at 12.13 hits/line" what does hits/line mean?

1.2k Views Asked by At

Recently I was working with rails project , and generated a code coverage report using simplecov, I got a nice report , below. I know it's a simple question ( I googled many times but not getting any proper explanation)

can anyone explain what does hits/line mean.

Also lets say I have a file test.rb (100 lines of code )which was not hit anytime , now lets say some test_script has hit some lines of file test.rb so will the coverage calculated by

 total no.of lines hit / total lines of code , (All files) 
                                      OR
lines hit / total lines of code (file1) .+.+....lines hit/ total line of code (file n) / total number of file count

enter image description here

1

There are 1 best solutions below

0
On

I believe it's the number of times each specific line was run during your suite. You can view line-by-line metrics by inspecting each file individually. The numbers you see displayed more prominently are averages over whole files or groups of files.