6

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

Avinash Agrawal
  • 1,038
  • 1
  • 11
  • 17

1 Answers1

6

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.

happylookout
  • 101
  • 3