Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 748
Avinash Agrawal Avatar asked Jan 25 '14 07:01

Avinash Agrawal


1 Answers

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.

like image 85
happylookout Avatar answered Oct 27 '22 15:10

happylookout